Webstorm can build react projects. The construction method is: first install webstorm and configure it; then configure the node environment under webstorm; then install and execute "npm install -g create-react-app" under the terminal; finally Just create a new react.
The operating environment of this tutorial: windows7 system, webstorm2020.3&&react16.4.0 version, Dell G3 computer.
Recommended: "webstorm tutorial"
Create React project with webstorm
Download and install webstorm, and then configure it, the configuration is successful:
After successful configuration, you can start the webstorm project.
1: Configure the node environment under webstorm:
2: After completion:
React official scaffolding address:
https://github.com/facebook/create-react-app
Install and execute npm install -g create-react-app in the terminal. You don’t need to install it for every project. Just install a webstorm once
#3: You can create a new react app project directly.
4: As shown above: After the installation is completed: execute npm list -depath0 (check the downloaded dependencies that are not empty Package)
or npm ls (check all downloaded dependent packages including empty files)
Complete and open the entrance
5: Finally, you can complete your own react project by yourself
Note: there must be top-level package elements: if not, an error is reported
As shown below:
6: Initialization:
Create a new component folder. And create a header.js as shown below: The button controls the visibility of the content
The class Header after the abbreviated class must be capitalized. If you need to export it to other places for reference, you must export the default class
7: Reference to the exported component
8: Final result
9: Package and go online after the project is completed. The file uploaded by running yarn build is as shown below
The above is the detailed content of Can webstorm build react projects?. For more information, please follow other related articles on the PHP Chinese website!