-
Notifications
You must be signed in to change notification settings - Fork 47.4k
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
Warning should appear when versions of react and react-dom do not match #14443
Comments
I think this is a neat idea and would be easy to add. Filing this as a good first issue. |
We were just discussing this in #14572 |
I'd like to do it! |
As far as I could tell - I have been trying around a bit on a branch on my fork - the simplest way is just to compare the versions in a warning that relies, for example, on the version string passed as attribute of the
And right now the React version is imported from a file in the Forgive my very basic questions, I am yet a humble beginner in the react source code. |
Ah, sorry I'm just getting to this. I've re-labelled this and let's keep the conversation going. |
Based on what @gaearon said in that issue
The ideal scenario is that React works fine with react-dom as long as the major version matches. In that scenario, we wouldn't need warnings when there is a mismatch in the minor/patch numbers. However, in my original issue, this is unfortunately not the case and there can be silent breaking changes between minor versions. I don't think it is realistic to have extensive compatibility testing between each combination of versions to ensure these issues don't appear. To me it is clear that some kind of warning should be presented, at a minimum. |
I thought about it a bit, a warning would be really nice, but it does not seem like an optimal solution in any way. If there is a minor version mismatch that won't be fixed for some reason and does not cause problems, the warning can be annoying. |
Do you want to request a feature or report a bug?
Request a feature
What is the current behavior?
If the version of react and react-dom do not match, some features fail silently. See this issue for example: reduxjs/react-redux#1125
In this issue, the new Context API wasn't working as intended, but no errors or warnings were visible. Components simply did not update. It turns out that this issue was because I updated react to version 16.6.3, but still had react-dom at version 16.5.
What is the expected behavior?
I would like to see some sort of warning message in the console in development mode when the versions of react and react-dom do not match.
The text was updated successfully, but these errors were encountered: