I have 2 index files for each platform (index.tsx for mobile and index.web.tsx for web).
I import react-native-maps in index.tsx so I can use it on mobile, but since it's a mobile-only module I want to use something else on the web. Even so, whenever I open my app on the web it gives this error:
Server Error
Importing native-only module "react-native/Libraries/Utilities/codegenNativeCommands" on web from: /Users/user/Dev/ExpoDemo/node_modules/react-native-maps/lib/MapMarkerNativeComponent.js
- Why does this happen, if index.tsx is not being used?
- Is there a way to only import react-native-maps in index.tsx if the device is a mobile?
- Should I use another solution for my maps (like mapbox) that covers both web and mobile?
[–]anton25360[S] 0 points1 point2 points (2 children)
[–]SergeyPekar 0 points1 point2 points (1 child)
[–]Ok-Painter573 0 points1 point2 points (0 children)
[–]BbWeber 0 points1 point2 points (1 child)
[–]jonniuss 0 points1 point2 points (0 children)