I have a React app, where props from a parent component are passed to a child component and the props then set the state on the child.
After I send an updated value to t
You need to implement componentWillReceiveProps in your child:
componentWillReceiveProps(newProps) { this.setState({name: newProps.name}); }
Edit: componentWillReceiveProps is now deprecated and will be removed, but there are alternative suggestions in the docs link above.
componentWillReceiveProps