Skip to content
This repository has been archived by the owner on Jun 3, 2024. It is now read-only.

Input only setState from props if setProps is defined. #350

Merged
merged 2 commits into from
Oct 30, 2018

Conversation

T4rk1n
Copy link
Contributor

@T4rk1n T4rk1n commented Oct 29, 2018

The component will receive the same initial props every time there is an update in the layout if they are not used in a callback and thus have no setProps. This add a check that only setState on the value if the component has setProps defined.

Copy link
Contributor

@valentijnnieman valentijnnieman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants