React Flashcards
What is the “reactstrap” module?
It allow you to import Bootstrap components and use them as react components
In the MERN stack, what directory does the front end code reside in?
client
In the MERN stack, where does the backend code reside?
In server.js (within root folder) and the routes directory.
Express and Mongoose are imported and the routes are within “./routes/api/items”
In the MERN stack, where does the production index.html file go (where “npm run build” looks)?
The “client/build” directory
When creating a full stack MERN application, what should your entry point be?
server.js
In the MERN stack, in which directory should you place your front end code?
client
How should you create a React app in an existing project with back-end code already written?
cd client
npm i -g create-react-app
create-react-app .
How should you import React to a file?
import React, { Component } from ‘react’;
This allows for “Component” shorthand instead of “React.Component”
Where should React components be stored in a MERN stack application?
~/client/src/components/component
In React, what file holds the code for the main page?
App.js
In React, what is the syntax for rendering HTML from App.js?
class App extends Component { render() { return( div className="App" ) }; }