Skip to content

Commit 2ae308c

Browse files
committed
Only reset state when this.props.value has changed
1 parent 315862c commit 2ae308c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/ReactCodeInput.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ class ReactCodeInput extends Component {
4343
}
4444

4545
UNSAFE_componentWillReceiveProps(nextProps) {
46-
if (nextProps.value == null) {
46+
if (nextProps.value == null || nextProps.value === this.props.value) {
4747
return;
4848
}
4949
this.setState({

0 commit comments

Comments
 (0)