Skip to content

devtools 1.1.1 + Immutable.js breaks pure render #88

Closed
@davidnorth

Description

@davidnorth

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions