- Full-Stack React Projects
- Shama Hoque
- 87字
- 2021-06-25 21:45:15
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.