Remove component state initialization

The state initialization is performed when the component goes into
submittin mode. However, after the form is submitted, the component
unmounts and the state is destroyed.
This commit is contained in:
Hannu Lyytikainen 2018-07-05 19:26:56 +03:00
parent 7c7acb4475
commit dee98675a9

View file

@ -113,9 +113,6 @@ class StripePaymentForm extends Component {
}
});
}
componentWillReceiveProps() {
this.setState(initialState);
}
componentWillUnmount() {
if (this.card) {
this.card.removeEventListener('change', this.handleCardValueChange);