I want call a method for the MapView component found in the docs. Here
I have absolutely no idea how to do it.
const Map = props => {
const mapRef = useRef();
const random = () => {
console.log(mapRef);
console.log(mapRef.current.getCamera());
}
return <MapView ref={mapRef} onClick={random()} style={styles.mapStyle} provider={PROVIDER_GOOGLE} region={props.region} />;
};
This is what I tried based on what I found online but I keep getting undefined is not an object (evaluating 'mapRef.current.getCamera')