mirror of
https://github.com/ascribe/onion.git
synced 2024-12-22 17:33:14 +01:00
Update form's email state if the email prop changes
This commit is contained in:
parent
0da3891d51
commit
f4227e9906
@ -41,6 +41,14 @@ let ConsignForm = React.createClass({
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
|
componentWillReceiveProps(nextProps) {
|
||||||
|
if (this.props.email !== nextProps.email) {
|
||||||
|
this.setState({
|
||||||
|
email: nextProps.email
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
getFormData() {
|
getFormData() {
|
||||||
return this.props.id;
|
return this.props.id;
|
||||||
},
|
},
|
||||||
|
@ -61,6 +61,14 @@ let LoanForm = React.createClass({
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
|
componentWillReceiveProps(nextProps) {
|
||||||
|
if (this.props.email !== nextProps.email) {
|
||||||
|
this.setState({
|
||||||
|
email: nextProps.email
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
onChange(state) {
|
onChange(state) {
|
||||||
this.setState(state);
|
this.setState(state);
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user