alex3165/react-leaflet-draw

No context provided: descendant of <MapContainer>

Closed this issue · 3 comments

Hello

I think the release 0.19.7 should be 0.20 because it is breaking compatibility with react-leaflet 2.7. For compatibility reason I have to user this old version of react leaflet.

With the latest release, react leaflet core is required and is only compatible with more recent version of react-leaflet that exposes MapContainer.

Error message is :
No context provided: useLeafletContext() can only be used in a descendant of

Fixed by forcing 0.19.0 version.

This should be a major version, because with this rule : "react-leaflet-draw": "^0.19.0" , leaflet-draw is broken.

Thank you for the lib which is very useful !

tnx, my bad, I didn't test anything, because I'm not using this lib

it's probably late to change version, please reopen this issue if this is not right

also, should I use version number 0.20 for next commit? Not clear too

Np ! Perfectly fine if it is closed now. Some people might find this issue useful if they have the same problem.
I think it is too late since the release is done.

And I perfectly understand you cannot test all the cases and libraries to know if it is a breaking version that should not be minor but major since npm handles the minor with specific rules.

@nalliot did you have a problem 'useLeafletContext()' with version "^0.19.7" and the solution with "0.19.0"?
But, what version leaflet-draw did you use with the version "0.19.0"?