nismod / irv-jamaica

Jamaica Systemic Resilience Assessment Tool
MIT License
0 stars 0 forks source link

Concurrent rendering in React 18 crashes the map. #41

Closed eatyourgreens closed 1 week ago

eatyourgreens commented 1 week ago

The React 18 concurrent rendering API crashes React Map GL with a null reference error:

Error: Invalid type: 'container' must be a String or HTMLElement.

For the time being, the old reactDOM.render() still works (but generates console warnings that it's deprecated.)

This might be caused by rendering the map inside a <Suspense> boundary. I'm not sure.

eatyourgreens commented 1 week ago

Rendering the base map layer outside of a suspense boundary may fix this. See #42.