mapcomponents / react-map-components-maplibre

A react component framework for declarative GIS application development.
MIT License
119 stars 18 forks source link

Bug: error when unmounting map component #180

Closed andrejilderda closed 2 months ago

andrejilderda commented 2 months ago

@mapcomponents/react-maplibre version: 1.0.5 (latest)

When unmounting the map component, an error occurs stating that mapHook.map.map.style is undefined. This is due to an incorrect property access in the useSource.ts file on line 31.

Steps To Reproduce

Unfortunately I couldn't reproduce the error in the Storybook... 💡 But I did find that when I changed the line above directly in the dist in my codebase, that the error was fixed and the component properly remounts.

The current behavior

It crashes when the map unmounts. Full stack trace:

image

The expected behavior

I expect it not to crash. :)