Skip to content

Commit eb52d20

Browse files
committed
Only reset state when this.props.value has changed
1 parent e5bd868 commit eb52d20

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/ReactCodeInput.js

Lines changed: 1 addition & 1 deletion
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

0 commit comments

Comments
 (0)