Skip to content

Commit

Permalink
Update state.value + state.input on props change 40818419#69 40818419…
Browse files Browse the repository at this point in the history
…#129

makes it possible to reset ReactCodeInput’s internal state and the values it renders in its inputs by passing in an updated this.props.value
  • Loading branch information
acusti committed Oct 15, 2021
1 parent 9ceff48 commit 5e05435
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/ReactCodeInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ class ReactCodeInput extends Component {
}

this.setState({
value: nextProps.value,
input: getInputArrayFromProps(nextProps),
value: getValueFromProps(nextProps),
});
}

Expand Down

0 comments on commit 5e05435

Please sign in to comment.