May 2018
Intermediate to advanced
470 pages
13h 54m
English
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.
Read now
Unlock full access