I have a form containing various input fields and two buttons; one for submitting and one for cancelling.
import React, { Component } from 'react' export default class Form extends Component { constructor(props) { super(props) this.formRef = React.createRef() this.state = { email: '', loading: false, eror: null } } reset = () => { this.formRef.current.reset() } render() { return ( Submit this.reset()}>Reset ) } }