-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
False-positive for rule no-this-in-sfc
#2147
Comments
Typically, render functions should be SFCs - however I agree that in this case (an object literal member, and a name that doesn't start with a capital letter) it shouldn't be detected as a component. (also, |
false positive for https://github.com/sequelize/sequelize models, need to use this.getDataValue('deadline') to get the underlying data value |
This code produces a false-positive error:
Problems:
Example
is not an SFC. It returns a plain object.renderNode
is a render function, thethis.handleClick
is valid reference to thehandleClick
function on the object returned byExample
.Expected behaviour:
The rule correctly detects the context of the render function and doesn't treat it as an SFC.
A smaller, console-testable example to show that the above code works:
Using:
[email protected]
[email protected]
"react/no-this-in-sfc": "error"
The text was updated successfully, but these errors were encountered: