Solution to webstorm not recognizing react: First click File in the menu bar, expand [Langu..& Frame..] on the left; then click the [JavaScript...] drop-down menu in the right panel , select JSX Harmony; finally click [Apply/OK].
The operating environment of this tutorial: windows7 system, webstorm2020.3&&React17 version. This method is suitable for all brands of computers.
Related learning recommendations: react video tutorial
Solution to webstorm not recognizing react:
webstorm does not The main reason for identifying react's syntax is that it uses the .js
suffix name, and there is jsx syntax in the code, which causes the editor not to recognize it. We can change it in the settings.
The specific solution steps are as follows:
Click File in the menu bar——Default Settings...
In Expand Languages & Frameworks on the left - JavaScript
In the [JavaScript language version] drop-down menu in the right panel, select JSX Harmony
Click Apply/OK.
Related learning recommendations: javascript video tutorial
The above is the detailed content of What should I do if webstorm doesn't recognize react?. For more information, please follow other related articles on the PHP Chinese website!