1. Create a basic project
You can use the create-react-app package or create an empty IntelliJ IDEA project and install React in it. create-react-app project address: https://github.com/facebookincubator/create-react-app
1.1. Use create-react-app to generate React applications [the first]
create React App is the recommended way to start building a new React Single Page Application. So your development environment is pre-configured to use webpack, Babel, ESLint and other tools. Learn more about how to install React and create React apps from the React official website .
1" Globally install create-react-app
Open the built-in terminal (View | Tool Windows | Terminal) and type npm install -g create-react-app at the command prompt.
2" Create an application
1》
above sea level start
Starts the development server.
npm run build
Bundles the app into static files for production.
above sea level test
Starts the test runner.
npm run eject
Removes this tool and copies build dependencies, configuration files
and scripts into the app directory. If you do this, you can’t go back!
We suggest that you begin by typing:
cd test_react_app above sea level start
Happy hacking! Done
Directory Structure
Note: To download project dependencies, do one of the following:
Open Terminal (View | Tool Windows | Terminal) and type npm install at the command prompt.
Select run 'npm install' in the context menu of the package.json file in the project root directory.
1.2. Install React in a blank IntelliJ IDEA project
In this case, you will have to configure the build pipeline yourself as described in Building a React application below . Learn more about how to add React to a project on the React official website .
1" Create an empty IntelliJ IDEA project
1》
3.3. Start with an existing React application
To continue developing an existing React application, open it in IntelliJ IDEA and download the required dependencies.
1" Open the application source already in the machine
File→Open
Or you can also check out the project from the repository
2" download dependencies
Run on the package, npm install