https://github.com/facebook/create-react-app
npm i -g create-react-app
cd <your-folder>
create-react-app hello-react
cd hello-react
Yarn start opens the 3000 port web page, which is equivalent to confirming whether the installation is successful [Development Environment]
yarn build
Yarn global bin copy and paste to path is equal to configure yarn environment variables
yarn global add serve
serve -s build (it is recommended to use cmd if there is a problem with git-bash) Port 5000 [online environment]
…………………………………………………………………………
Open the react devtools management extension to allow access to the file, you don't need to remember it because the help documentation says it.
import Header from './components/header' import Footer from './components/footer' class App extends Component { render() { return ( <div className="container"> <div className="row"> <Header /> </div> <div className="row"> <div className="col-xs-1 col-xs-offset-11"> <h1>Hello !</h1> </div> </div> <div className="row"> <Footer /> </div>
<div className="row">
{ true?"hi":"goodbye" /* this is an expression*/}
</div> </div> ); } }