1. How do you create a React App from the terminal command line?
npx create-react-app my-app
2. If you clone a React App that has already been created, what command is needed to start developing with its dependencies?
npm install
3. How do you start the in-browser development server for a React App?
enter into the file in the terminal and then
npm start
4. What folder in a React App should component files be created in?
src file
5. What is the syntax for a function based component?
functionName() {
logic/variables
return<div></div>
}
export default Name
6. What direction are props passed in a React Component?
uni-directional flow
7. How is a React Component accessed in another file?
at the end of your component make sure export.
export default ComponentName
then on your new file import it
import ComponentName from './components/ComponentName'
8. How do we gain access to props in a child component?
You must set the parameter of your component functionto props
functionComponentName(props) {}
now you can call the prop from the app.js in your component function. at the return tag enter in {props.name}
ex.
functionComponentName (props) {
return<div>{props.name}</div>
}