You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to create a functioning react-map popup component within a DeckGL layer, using DeckGL's ContextProvider: ContextProvider={MapContext.Provider}
This, of course, doesn't work, as indicated by the react-map-gl docs for upgrading to v7.0:
If you are using react-map-gl controls (Marker, Popup, NavigationControl etc.) with deck.gl's ContextProvider, do not upgrade to this version. The old approach no longer works with v7. We are moving the support for this use case to a new project that does not depend on mapbox.
The specific error, via the web console, is:
Uncaught TypeError: Cannot destructure property 'map' of '(0 , import_react5.useContext)(...)' as it is null. at Popup (popup.ts:42:10) at renderWithHooks (react-dom.development.js:15486:18) at updateForwardRef (react-dom.development.js:19245:20) at beginWork (react-dom.development.js:21675:16) at beginWork$1 (react-dom.development.js:27465:14) at performUnitOfWork (react-dom.development.js:26596:12) at workLoopSync (react-dom.development.js:26505:5) at renderRootSync (react-dom.development.js:26473:7) at recoverFromConcurrentError (react-dom.development.js:25889:20) at performConcurrentWorkOnRoot (react-dom.development.js:25789:22)
This is because MapContext is null in the following line (42) in popup.ts: const {map, mapLib} = useContext(MapContext);
I'm just curious if anyone has found any workaround or fix to this issue or has any suggestions on what I might consider trying, short of downgrading my react-map-gl and deck-gl versions. I know this is probably a long shot as they explicitly say it won't work, but I figure it's worth a shot.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I'm trying to create a functioning react-map popup component within a DeckGL layer, using DeckGL's ContextProvider:
ContextProvider={MapContext.Provider}
This, of course, doesn't work, as indicated by the react-map-gl docs for upgrading to v7.0:
The specific error, via the web console, is:
This is because
MapContext
is null in the following line (42) in popup.ts:const {map, mapLib} = useContext(MapContext);
I'm just curious if anyone has found any workaround or fix to this issue or has any suggestions on what I might consider trying, short of downgrading my react-map-gl and deck-gl versions. I know this is probably a long shot as they explicitly say it won't work, but I figure it's worth a shot.
Thank you!
Beta Was this translation helpful? Give feedback.
All reactions