Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

HarryHenryGebel
Copy link

@HarryHenryGebel HarryHenryGebel commented Aug 18, 2020

Fixes #192.

Warning was caused by componentWillReceiveProps being deprecated. The component functions fine without it, so I removed the method.

this.fireChangeEvent = this.fireChangeEvent.bind(this)
}

componentWillReceiveProps (newProps) {
Copy link
Owner

Choose a reason for hiding this comment

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

I believe this is still needed if the value gets changed outside of the component itself.

See we have an app like this:

<Parent>
  <Child value={value} updateValue={updateValue}/>
  <Dropdown value={value}/>
</Parent>

If <Child> updates the value, the Dropdown will also need to know when the value gets updated outside.

@fraserxu
Copy link
Owner

Hi @HarryHenryGebel Thanks for the PR! I've included the change for the duplicated React method in #170 Can you please rebase and happy to get this updates in later.

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

Successfully merging this pull request may close these issues.

Deprecation warning with React 16.13: "Warning: componentWillReceiveProps has been renamed"
2 participants