Adding the add functionality
We went through the MUI modal form in Chapter 11, Useful Third-Party Components for React.
We will add the New Car button to the user interface, which opens the modal form when it is pressed. The modal form contains all the fields that are required to add a new car, as well as the buttons for saving and canceling.
- Create a new file called
componentsfolder and write some functional component base code to the file, as shown here. Add the imports for the MUI
import Dialog from '@mui/material/Dialog'; import DialogActions from '@mui/material/DialogActions'; import DialogContent from '@mui/material/DialogContent'; import DialogTitle from &apos...