react-code-input
react-code-input copied to clipboard
Value prop changes are not reflected in the display
Currently the value prop only sets the initial value. However, I would like value to instead behave like it would for a standard input field, where changes in the value prop would be reflected in the display. In this manner it would be behaving similar to a standard React controlled component https://reactjs.org/docs/forms.html#controlled-components
Hey folks, I opened a PR aiming to fix this.
Also took the opportunity to move from componentWillReceiveProps
to getDerivedStateFromProps
, to make the component future-proof. Feel free to give some feedback!
@thmsmontana can you please fix tests and reopen PR? Thank you!
Any updates on this?
Will this be fixed any time soon? 👀
any updates?
use key property,when key was changed then render immediately,such as:
<ReactCodeInput fields={6} name="roomnum" inputMode="numeric" value={roomnum} key={roomnum}/>