Component definition

In the component definition, we will compose the content and behavior of the component. The Home component will contain a Material-UI Card with a headline, an image, and a caption, all styled with the classes defined earlier and passed in as props.

mern-skeleton/client/core/Home.js:

class Home extends Component {  render() {    const {classes} = this.props     return (      <div>        <Card className={classes.card}>          <Typography type="headline" component="h2" className=          {classes.title}>            Home Page          </Typography>          <CardMedia className={classes.media} image={seashellImg}           title="Unicorn Shells"/>          <CardContent>            <Typography type="body1" component="p">              Welcome to the Mern Skeleton home page            </Typography>          </CardContent>        </Card>      </div>    )  }}

Get Full-Stack React Projects 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.