-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
React 16 lifecycle errors appearing in a React 15 project #1789
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
Comments
* v3.14.2 * rebuild dist * constrict `eslint-plugin-react` version jsx-eslint/eslint-plugin-react#1789
https://github.com/swagger-api/swagger-ui/blob/d256ae87d310b40fb9fd5cc52ec2aa7db55b28ca/.eslintrc Doesn’t specify a react version pragma, so as far as eslint is concerned, it’s a React 16.3 project. If you specify your react version, you’ll get appropriate error messages. |
Thanks @ljharb, I wasn't aware of the pragma setting! From my perspective, having my linter (and therefore, my build) break due to a changing default in this plugin was not a fun thing to discover. I do see that the plugin documents its changing default React target version ( Perhaps a warning if a pragma is not present would provide a better experience than finding out the hard way when something like this happens? |
Adding a warning for that sounds like a great idea. |
We have faced same error messages with react 16.2. Adding react version to .eslintrc file fixed the problem.
|
Adding the react version is good to know, however like @shockey said, this isn't great behaviour. Ideally, any rules that are modified to break where they didn't before should be breaking changes rather than something that gets picked - usually automatically with a minor bump |
@alasdairhurst there's always cases, however, where that constitutes a bugfix - ie, the bug was "it wasn't warning" and now it is. |
* v3.14.2 * rebuild dist * constrict `eslint-plugin-react` version jsx-eslint/eslint-plugin-react#1789
* v3.14.2 * rebuild dist * constrict `eslint-plugin-react` version jsx-eslint/eslint-plugin-react#1789
I'm getting
react/no-deprecated componentWillReceiveProps
errors in a React 15 project 😢[email protected]
,eslint-plugin-react@^7.1.0
The text was updated successfully, but these errors were encountered: