Open Kutomore opened 1 year ago
To fix this I had to access Marker
as a property of the MapView
object on the web. But on native I still needed to access it the old way. So instead of:
import MapView, { Marker } from 'react-native-maps';
I did:
import MapView, {Marker as NativeMarker} from 'react-native-maps';
import {Platform} from 'react-native';
const {Marker: WebMarker} = MapView;
const Marker = Platform.select({web: WebMarker, default: NativeMarker});
This worked for me on both native and web.
I'm trying to build an App right now using Expo, since react-native-maps does not include web support and they suggested in an issue people should try this out I wanted to give it a go.
Followed the steps and this works flawlesly as far as I can tell
But as soon as I include a Marker, like so:
I get a bunch of errors in my console:
Couldn't figure out what's broken in this scenario, also can't find any other resource on using maps on web with react-native.