From 48fed8d615b4bf5c63ad3fdb283246351b4d7886 Mon Sep 17 00:00:00 2001 From: Andrew Patton Date: Thu, 14 Oct 2021 17:30:50 -0700 Subject: [PATCH] Only reset state when this.props.value has changed --- src/ReactCodeInput.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ReactCodeInput.js b/src/ReactCodeInput.js index 15d72bc..e233fb9 100644 --- a/src/ReactCodeInput.js +++ b/src/ReactCodeInput.js @@ -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; }