Skip to content

Commit e5bd868

Browse files
committed
Update state.value + state.input on props change #69 #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
1 parent e309d54 commit e5bd868

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/ReactCodeInput.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ class ReactCodeInput extends Component {
4848
}
4949

5050
this.setState({
51-
value: nextProps.value,
51+
input: getInputArrayFromProps(nextProps),
52+
value: getValueFromProps(nextProps),
5253
});
5354
}
5455

0 commit comments

Comments
 (0)