Removed componentWillUpdate

This commit is contained in:
orangemug
2018-08-06 22:24:13 +01:00
parent c5ea9494df
commit 1aa90bef37
7 changed files with 52 additions and 48 deletions

View File

@@ -18,8 +18,10 @@ class StringInput extends React.Component {
}
}
UNSAFE_componentWillReceiveProps(nextProps) {
this.setState({ value: nextProps.value || '' })
static getDerivedStateFromProps(props, state) {
return {
value: props.value || ''
};
}
render() {