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

View File

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