December 2019
Intermediate to advanced
598 pages
12h 21m
English
We already have a submit button in the Form component that submits the form. We aren't handling the form submission yet though. Let's handle form submission, which includes a call to a function passed in by the consumer:
import { FC, useState, createContext, FormEvent } from 'react';
<form noValidate={true} onSubmit={handleSubmit}> ...</form>
When the submit button is clicked on the form, the submit event will be triggered and a function called handleSubmit will be invoked.
const handleSubmit ...