Ask questionsDouble rendering (Lifecycle hook scheduled a cascading update) after item selection
Hello!
When using Downshift with controlled selectedItem property it always triggers cascading update from componentDidUpdate() after selection has changed.
Here is a guilty excerpt
if (
this.isControlledProp('selectedItem') &&
this.props.selectedItemChanged(
prevProps.selectedItem,
this.props.selectedItem,
)
) {
this.internalSetState({
type: stateChangeTypes.controlledPropUpdatedSelectedItem,
inputValue: this.props.itemToString(this.props.selectedItem),
})
}
There should be a way to move this piece of code away from componentDidUpdate hook to run before any rendering occurs.
Answer
questions
yuriploc
@silviuavram, see if this https://github.com/reduxjs/react-redux/issues/834 issue helps you.
Related questions