Skip to content
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

Redux form doesn't handle recursive structures as props to Field component due to deepEqual #3810

Closed
itsuryev opened this issue Feb 2, 2018 · 3 comments

Comments

@itsuryev
Copy link
Contributor

itsuryev commented Feb 2, 2018

Hello,

I've encountered an issue with deepEqual inside of ConnectedField shouldComponentUpdate call.
Code in question:

        ...
        nextPropsKeys.some(prop => {
          return (
            !~propsToNotUpdateFor.indexOf(prop) &&
            !deepEqual(this.props[prop], nextProps[prop])
          )
        })

In my case one of the props is immutable recursive structure which makes this check run in circles.
To handle this on form level we have immutableProps:

immutableProps : Array<String> [optional]
Prop names that only require strict-equals, not deep equals, to determine shouldComponentUpdate. Useful for performance and compatibility with 3rd party immutable libraries. Defaults to [].

But somehow they are not applied on Field level.

Thank you!

@itsuryev
Copy link
Contributor Author

itsuryev commented Feb 20, 2018

Hello!

Can we please start the ball rolling on this one, at least the discussion.

In the linked pull request (#3849) I've added immutableProps option to Field component, test that everything fails without it and updated documentation to list new option.
What else should be done?

Thank you!

I humbly summon you, mighty @erikras

@erikras
Copy link
Member

erikras commented Jun 12, 2018

Fix released in v7.4.0.

@lock
Copy link

lock bot commented Jun 12, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Jun 12, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants