WebStorm导入React Native项目

1. File -> Open ->导入项目;

2. 导入项目显示Node.js,不能直接运行

直接运行index.js会出现错误,参考: WebStorm导入项目配置错误:(function (exports, require, module, __filename, __dirname) { import { AppRegistry } from 'react-native';

3. 添加React Native运行配置:

双击Edit Configurations,打开Run/Debug Configurations,点击左上角“+”,选择“React Native”,可以填入一个名字,点击OK

4:运行配置切换到“React Native”,然后进行运行,也可以直接把index.js运行配置删除;

猜你喜欢

转载自blog.csdn.net/niuba123456/article/details/82020156