Hello guys I'm pretty new at React js and I just started using the react-stripe-js. My question is, is it possible to make stay the value in Stepper Elements in React Stepper after changing page? Your answers are very much appreciated.
Sample Design Stepper with Stipe Elements
class CheckoutForm extends React.Component {
handleSubmit = (ev) => {
ev.preventDefault();
this.props.stripe
.createPaymentMethod('card')
.then((payload) => {
console.log('[pm]', payload)
});
this.props.stripe
.createToken({type: 'card', name: 'Jenny Rosen'})
.then((payload) => {
console.log(payload)
});
this.props.stripe.createSource({
type: 'card',
owner: {
name: 'Jenny Rosen',
},
});
};
render() {
return (
<form onSubmit={this.handleSubmit}>
<CardSection />
<button>Confirm order</button>
</form>
);
}
}
//CardSection.js
class CardSection extends React.Component {
render() {
return (
<>
<label>
Name
<input name="name" type="text" placeholder="Jane Doe" required />
</label>
<label>
Card details
<CardNumberElement style={{base: {fontSize: '18px'}}}/>
<CardExpiryElement style={{base: {fontSize: '18px'}}} />
<CardCVCElement style={{base: {fontSize: '18px'}}} />
</label>
</>
);
}
}