Using the Button component

Let's first change all the buttons to use the Material-UI Button component. Import Button to the AddCar.js file:

// AddCar.jsimport Button from '@material-ui/core/Button';

Change the buttons to use the Button component. In the list page, we are using the outlined button and in the modal form, we use buttons without any borders. The following code shows the AddCar component:

return (    <div>      <Button variant="outlined" color="primary" style={{margin: 10}} onClick={handleClickOpen}>        New Car      </Button>      <Dialog open={open} onClose={handleClose}>          <DialogTitle>New car</DialogTitle>          <DialogContent>            <input type="text" placeholder="Brand" name="brand"               value={car.brand} onChange={handleChange}/><br/>  <input type="text" placeholder="Model" ...

Get Hands-On Full Stack Development with Spring Boot 2 and React - Second Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.