Custom Input props value change must be reflected (#2734) (#2735)

This commit is contained in:
Nicolas Gotchac 2016-10-19 17:34:56 +01:00 committed by Gav Wood
parent 048d6968b0
commit 319cfb278c

View File

@ -53,6 +53,12 @@ export default class Input extends Component {
value: this.props.value
}
componentWillReceiveProps (newProps) {
if (newProps.value !== this.props.value) {
this.setValue(newProps.value);
}
}
render () {
const { value } = this.state;
const { children, className, disabled, error, label, hint, multiLine, rows, type } = this.props;