Using the Button component
Execute the following steps to implement the Button component:
- Let's first change all the buttons to use the MUI
Buttoncomponent. ImportButtonto theAddCar.jsfile:// AddCar.js import Button from '@mui/material/Button';
- Change the buttons to use the
Buttoncomponent. In the list page, we are using the contained button (variant="contained") and in the modal form, we use the text buttons (default).
The following code shows the AddCar component's return statement with the changes:
// AddCar.js
return(
<div>
<Button variant="contained" onClick={handleClickOpen}>
New Car
</Button>
<Dialog open={open} onClose={handleClose}>
<DialogTitle...