Redux-form: v6 shouldComponentUpdate

Created on 26 Apr 2016  路  3Comments  路  Source: redux-form/redux-form

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?

bug

All 3 comments

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

Good catch.

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

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.

Was this page helpful?
0 / 5 - 0 ratings