I installed react-native-router using yarn and just on importing NativeRouter
This is how I import from react-router-native import { NativeRouter, Route, Link } from "react-router-native";
This is the error I get
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} />;
| }
|
Had the same error. Fixed by adding:
"web": {
"build": {
"babel": {
"include": ["react-router-native"]
}
}
}
to app.json
From: source
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With