Using the Button component
Execute the following steps to implement the Button
component:
- Let's first change all the buttons to use the MUI
Button
component. ImportButton
to theAddCar.js
file:// AddCar.js import Button from '@mui/material/Button';
- Change the buttons to use the
Button
component. 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...