mirror of
https://github.com/ascribe/onion.git
synced 2024-12-22 09:23:13 +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() {
|
||||
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) {
|
||||
this.setState(state);
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user