fix frozen validation input field

This commit is contained in:
or-else
2022-08-27 12:51:52 -07:00
parent 5006a6fb34
commit 22320808fc
5 changed files with 9 additions and 9 deletions
+3 -3
View File
@@ -21,7 +21,7 @@ class ValidationView extends React.PureComponent {
this.state = {
code: props.credCode || '',
codeReceived: false
codeReceived: props.credCode
};
this.handleChange = this.handleChange.bind(this);
@@ -31,10 +31,10 @@ class ValidationView extends React.PureComponent {
}
static getDerivedStateFromProps(nextProps, prevState) {
if (nextProps.credCode != prevState.code) {
if (nextProps.credCode != prevState.codeReceived) {
return {
code: nextProps.credCode || '',
codeReceived: !!nextProps.credCode
codeReceived: nextProps.credCode
};
}