I am using react-simple-maps v.3.0.0
When I use useMapContext() as instructed in the document, I am getting undefined.
Cannot destructure property 'projection' of 'useMapContext(...)' as it is undefined.
import {
ComposableMap,
Geographies,
Geography,
Marker,
ZoomableGroup,
useMapContext,
} from "react-simple-maps"
// ...
const MyMap = () => {
const { projection } = useMapContext() // crashes dev app here
// ...
return (
<ComposableMap ... >
<ZoomableGroup>
<Geographies geography={geoURL}>
...
)
}
Are there any prerequisites to use this hook?
I am using react-simple-maps v.3.0.0
When I use
useMapContext()as instructed in the document, I am getting undefined.Are there any prerequisites to use this hook?