iam*_*sha 6 react-native react-router-native
我使用 yarn 安装了 react-native-router 并且只导入了 NativeRouter
这就是我从 react-router-native import { NativeRouter, Route, Link } from "react-router-native" 导入的方式;
这是我得到的错误
D:/WORKSHOP/Tunga/music-app/node_modules/react-router-native/NativeRouter.js 11:9
Module parse failed: Unexpected token (11:9)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
| */
| function NativeRouter(props) {
> return <MemoryRouter {...props} />;
| }
|
Run Code Online (Sandbox Code Playgroud)
小智 9
有同样的错误。通过添加修复:
"web": {
"build": {
"babel": {
"include": ["react-router-native"]
}
}
}
Run Code Online (Sandbox Code Playgroud)
到 app.json
来自:来源
| 归档时间: |
|
| 查看次数: |
1293 次 |
| 最近记录: |