
上QQ阅读APP看书,第一时间看更新
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 (
<p>
<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>
</p>
)
}
}