jsx-eslint/eslint-plugin-react
在 GitHub 查看function-component-definition should ignore function with `this`
Open
#2,781 创建于 2020年9月1日
bughelp wanted
仓库指标
- Star
- (8,630 star)
- PR 合并指标
- (30 天内没有已合并 PR)
描述
This is a polyfill for IE:
Element.prototype.closest = function (s) {
let el = this
if (!document.documentElement.contains(el)) return null
do {
if (el.matches(s)) return el
el = el.parentElement || el.parentNode
} while (el !== null && el.nodeType === 1)
return null
}
it needs access to this and function-component-definition complains about it.