-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
devtools 1.1.1 + Immutable.js breaks pure render #88
Comments
Thanks for failing test, best way to start a discussion!
|
OK, I'll investigate why I'm not seeing the state. |
I'm closing until further details. |
@gaearon I think I can shed some light on the Immutable part of this conversation. #79 enabled more convenient rendering of Immutable objects by differentiating them from other In your test case above, @davidnorth, the state being passed as the root node is an Immutable object, and so |
@gaearon I just published 0.1.6 for react-json-tree which pulled in @EvanSimpson's changes and I confirmed that an immutable object can be at the root. |
👍 for upgrading react-json-tree to 0.1.6 to fix seeing immutable objects in state, which our team is also affected by |
There's a PR attempted to fix it: #133 |
This is fixed in |
I found that when implementing shouldComponentUpdate, an immutable value in this.props doesn't have the same identity as that value in nextProps when expected. You end up comparing 2 different Immutable maps with the same attributes.
This happens when an action has updated that component's bit of state earlier then some other unrelated action is dispatched, possibly one that does nothing. The component is comparing a reference to that bit of state it had following the first action with the same following the second action. They should have the same identity since the second action's didn't touch that bit of state.
I wrote a failing spec that reproduces the problem. I found that removing devTools caused it to pass.
https://gist.github.com/davidnorth/b6c5991756a7fdaf4d81
Also, I don't know if it's related, but since upgrading to 1.1.1 I no longer see anything of the state in dev tools, only the actions, where previously I saw the raw immutable object representation.
The text was updated successfully, but these errors were encountered: