(#7) How works preventDefault()Method?
Jun 3, 2021
Definition
The preventDefault() method cancels the event if it is cancelable, meaning that the default action that belongs to the event will not occur.
const submitHandler = (e) =>{
e.preventDefault()
dispatch(savePaymentMethod(paymentMethod)) history.push(‘/placeorder’) }<Form.Check
type='radio'
label='PayPal or Credit Card'
id='paypal'
name = 'paymentMethod'
checked
onChange={(e) => setPaymentMethod(e.target.value)} >
</Form.Check>