-
-
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
Add support for React 16 #1442
Comments
Adding these things only when the pragma is set to 16+ seems great; provided that the default is not changed prior to React 16 getting actually released. If we're going to do this, let's take the opportunity to put the list of lifecycle methods in a single place :-) |
Another thing we should test: since it's now possible to return an array from
Edit: it works already. The rule was already smart enough to detect arrays! |
Hi, I just wanna find out how soon we might have this features! Thanks for the great work! |
Another one I just stumbled across: |
Getting error |
The following changes were merged to support React 16:
Is there still something missing for React 16 support ? |
Unless I'm misunderstanding something, https://github.com/yannickcr/eslint-plugin-react/blob/master/lib/rules/jsx-uses-react.js doesn't match for Fragments, and so a file with only a JSX Fragment and no other elements will raise
Removing React does correctly raise
due to d51b0cc (for #1758 mentioned above) I observed this in eslint-plugin-react@7.8.2 pulled in from react-scripts@2.0.0-next. I guess that the fix is simply to handle |
I'm pretty sure we have full support for React 16, and 17, so I'll close this. If anything's missing, please file a new issue. |
I think it would be great if this plugin would be ready with supporting all the new things that React 16 has to offer.
Currently I'm not sure exactly what would need to to be added though. The only thing I could think of was the
componentDidCatch
"lifecycle method" that got added. This should be added to a number of rules (prop-types
,no-unused-prop-types
,no-typos
) and should only be checked when using React 16.The text was updated successfully, but these errors were encountered: