Closed rdewit closed 8 years ago
When using the Tooltip component within a CircleMarker, unmounting the component will with the following error:
Tooltip.js?9132:107 Uncaught TypeError: this.context.popupContainer.removeLayer is not a function
This is because of the popupContainer (i.e. the marker) may not have a 'removeLayer' method: https://github.com/PaulLeCam/react-leaflet/blob/next/src/Tooltip.js#L44
No error on componentWillUnmount
And 'Uncaught TypeError' on componentWillUnmount
Create something like this:
<CircleMarker center={markerPosition}> <Tooltip> <div>Nice tooltip!</div> </Tooltip> </CircleMarker>
Then cause a componentWillUnmount and you'll see the error in your console.
You can see it in action here: jsfiddle
Thanks for reporting this, should be fixed in beta 3.
When using the Tooltip component within a CircleMarker, unmounting the component will with the following error:
Tooltip.js?9132:107 Uncaught TypeError: this.context.popupContainer.removeLayer is not a function
This is because of the popupContainer (i.e. the marker) may not have a 'removeLayer' method: https://github.com/PaulLeCam/react-leaflet/blob/next/src/Tooltip.js#L44
Expected behavior
No error on componentWillUnmount
Actual behavior
And 'Uncaught TypeError' on componentWillUnmount
Steps to reproduce
Create something like this:
Then cause a componentWillUnmount and you'll see the error in your console.
You can see it in action here: jsfiddle