/src',
rootPathPrefix: '~/', // 使用 ~/ 代替 ....],
},
],
],
};
修改import路径测试
清除rn缓存并重新启动项目
yarn clear-run
"scripts": {
"android": "react-native...run-android",
"ios": "react-native run-ios",
"start": "react-native start",
"test": "jest",...",
"prepare": "husky install",
"clear": "yarn cache clean",
"clear-run": "react-native start --...,
"del": "rimraf node_modules yarn.lock"
},
可以看到项目可以正常启动、正常运行
修复函数跳转到定义功能
再项目根目录增加 jsconfig.json 文件