fix(donate): use intialState as recommended

This commit is contained in:
Mrugesh Mohapatra
2019-02-14 14:40:10 +05:30
committed by Stuart Taylor
parent 6c41dd2b7c
commit a30637d934
2 changed files with 3 additions and 4 deletions

View File

@ -25,7 +25,7 @@ const propTypes = {
createToken: PropTypes.func.isRequired
})
};
const initialSate = {
const initialState = {
donationAmount: 500,
donationState: {
processing: false,
@ -45,7 +45,7 @@ class DonateForm extends Component {
super(...args);
this.state = {
...initialSate,
...initialState,
email: null,
isFormValid: false
};
@ -156,7 +156,7 @@ class DonateForm extends Component {
}
resetDonation() {
return this.setState(() => initialSate);
return this.setState({...initialState});
}
renderCompletion(props) {

View File

@ -68,7 +68,6 @@ class DonateModal extends Component {
renderMaybe() {
const { closeDonationModal } = this.props;
const handleClick = e => {
console.log(e.target);
e.preventDefault();
return closeDonationModal();
};