Open ramanguptazelhus opened 4 months ago
- Please use the componentDidUpdate method for the updating the state.
@ramanguptazelhus Did you fixed this issue in your codebase? If so, can you share how you did it?
add this to the picker.js file within the class:
componentDidUpdate(prevProps) {
if (prevProps.selectedValue !== this.props.selectedValue) {
this.setState({ selectedValue: this.props.selectedValue });
}
}
PR created here: https://github.com/TronNatthakorn/react-native-wheel-pick/pull/54
Worked on my app
add this to the picker.js file within the class:
componentDidUpdate(prevProps) { if (prevProps.selectedValue !== this.props.selectedValue) { this.setState({ selectedValue: this.props.selectedValue }); } }
PR created here: #54