Imports

The component file will start with imports from React, Material-UI, React Router modules, images, CSS, API fetch, and auth helpers from our code as required by the specific component. For example, for the Home component code in Home.js, we use the following imports.

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

import React, {Component} from 'react'import PropTypes from 'prop-types'import {withStyles} from 'material-ui/styles'import Card, {CardContent, CardMedia} from 'material-ui/Card'import Typography from 'material-ui/Typography'import seashellImg from './../assets/images/seashell.jpg'

The image file is kept in the client/assets/images/ folder and imported/added to the Home component.

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.