Skip to content

Commit

Permalink
Only reset state when this.props.value has changed
Browse files Browse the repository at this point in the history
  • Loading branch information
acusti committed Oct 15, 2021
1 parent 18c0f66 commit 48fed8d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/ReactCodeInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class ReactCodeInput extends Component {
}

UNSAFE_componentWillReceiveProps(nextProps) {
if (nextProps.value == null) {
if (nextProps.value == null || nextProps.value === this.props.value) {
return;
}

Expand Down

0 comments on commit 48fed8d

Please sign in to comment.