-
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
Expected state to match memoized state before componentDidMount #18090
Comments
The warning is a little misleading. What actually happens here is something is reassigning |
Mentioned in facebook#18090.
Mentioned in facebook#18090.
@jddxf is right; this warning should reference As for why you're encountering this in your own app, it's almost certainly because you are reassigning (If you find that you're hitting this where no one is setting this.state, that would likely be a bug in React and we can reopen in that case.) |
@jddxf @sophiebits thank you for your replies. A question, is this just a warning or it will actually be show-stopper? Is it OK if I could ignore it and my codes still run? |
I can't point to any concrete problems it will cause today, but I would recommend against it. There may be incompatibilities with future versions of React. |
Have narrowed down the problem to:
... particularly the Perhaps, any expert here can suggest alternative code to overcome this please? @sophiebits ? |
There's nothing wrong with the code you quoted in isolation, though it would depend what Store.subscribe and onData do. |
Hmm, then really clueless to me. As the isolated part is redux thing. Shouldn't trigger said warning. Thank you anyway. |
For the next pour soul, I had the following code:
And I fixed this error by doing this instead:
This code was all running before the React component had a chance to mount, of course. |
Why not prepare the object first and then |
Upgrading
meteor
(from 1.4 to 1.7) andreact
(from 15.3.2 to 16.8.6) and got this warning at browser console:Note: My codes ain't using
react-css-modules
or havingthis.props = ...
syntax as suggested in #14224React version: 16.8.6
Steps To Reproduce
Here is my code (which I have narrowed down to, likely at onPropsChange part)
list.js
The current behavior
Causing table listing not appearing in my case.
The expected behavior
Table with rows of data to be listed
The text was updated successfully, but these errors were encountered: