I found a case where an Uncaught TypeError: map.style is undefined-error is thrown for this line when a map containing a RSource and/or RLayer was remounting. As the error implies the style property on map is accessed but not defined at that moment.
How to reproduce
I have tried to create a small reproduction in Storybook that was very similar to my setup, but unfortunately couldn't trigger the error.
maplibre-react-components version
0.1.7
your OS, React version
macOS, React 18.2.0
Description
I found a case where an
Uncaught TypeError: map.style is undefined
-error is thrown for this line when a map containing aRSource
and/orRLayer
was remounting. As the error implies thestyle
property onmap
is accessed but not defined at that moment.How to reproduce
I have tried to create a small reproduction in Storybook that was very similar to my setup, but unfortunately couldn't trigger the error.
Possible Solution
🕊️ PR incoming.