Using WebStorm to write RN programs, especially the JSX syntax part, is very 💔 for me, who has just contacted RN development. The code prompt is really unfriendly, and I am used to writing iOS code, so I have a sense of dependence on xcode-friendly prompt. However, there are still many community leaders, providing an RN code prompt assistant tool:

ReactNative-LiveTemplate

Address: github.com/virtoolsweb…


According to the prompt document, and need to be ReactNative. XML copy ~ / Library/Preferences/WebStorm11 / templates directory.

Note:

1. You need to check the WebStorm directory version installed on your computer

2. Restart WebStorm after the installation


Here is a pit:

If you run the cp command on the terminal to copy the file to a specified directory, restart WebStorm and find that Tab and enter keys are invalid.


The best way to do this is to open finder, hit Shift + Command +G, type in the WebStorm directory, create a templates folder, copy the ReactNative. XML file into it, and restart WebStorm.



Restart WebStorm, and while writing RN, you can display the prompt code using the shortcut command+J.