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

v6 shouldComponentUpdate #866

Closed
anyong opened this issue Apr 26, 2016 · 3 comments
Closed

v6 shouldComponentUpdate #866

anyong opened this issue Apr 26, 2016 · 3 comments
Labels
Milestone

Comments

@anyong
Copy link

anyong commented Apr 26, 2016

The component my form is in needs to call some async data before it loads the form. Normally I just check props.fetching and render null if it's still fetching, but the shouldComponentUpdate of the connected component blocks this prop from re-rendering. I have separated it into two components now so that the fetching happens outside of the reduxForm connected components, but I'm wondering if shouldComponentUpdate shouldn't check for the form props or any additional props that may have been passed to it.

Something like:

{...propsToUpdateFor, ...otherFormProps, ...userAddedProps} = nextProps;
// dont think spread work there but just so you get the idea

const actualPropsToUpdateFor = propsToUpdateFor.concat(userAddedProps);

What do you think?

@erikras
Copy link
Member

erikras commented Apr 26, 2016

Interesting... I implemented it with a whitelist of props to allow rerender, and it needs to be a blacklist.

Good catch.

@erikras erikras added the bug label Apr 26, 2016
@ooflorent ooflorent modified the milestone: next-6.0.0 Apr 28, 2016
@erikras
Copy link
Member

erikras commented May 12, 2016

This was fixed in v6.0.0-alpha.8, but I forgot to mention it. Sorry.

@erikras erikras closed this as completed May 12, 2016
@lock
Copy link

lock bot commented Jun 3, 2018

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 3, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants