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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.