Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not compatible with react-leaflet v3? #123

Closed
barbalex opened this issue Nov 2, 2020 · 12 comments · Fixed by #194
Closed

Not compatible with react-leaflet v3? #123

barbalex opened this issue Nov 2, 2020 · 12 comments · Fixed by #194
Milestone

Comments

@barbalex
Copy link

barbalex commented Nov 2, 2020

I tried upgrading my project to react-leaflet v3.0.0.

This is the component I tested: https://github.com/barbalex/apf2/blob/3c90de3a89c23ac720ccae00dc9bdedb71cfd6d0/src/components/Projekte/Karte/layers/Pop/index.js#L166-L175

It works well with react-leaflet v2.8.0 and react-leaflet-markercluster v2.0.0.

It breaks when using react-leaflet v3.0.0, causing this error:
mk-error 2
mk-error

I guess this is not surprising as react-leaflet v3 is a complete rewrite. For instance, accessing the map has changed.

@yuzhva
Copy link
Owner

yuzhva commented Nov 3, 2020

Hey hi, @barbalex

Thank you for creating the issue.
I did not know, that v3.0.0 of react-leaflet has been released.

Don't know, how long the migration to v3 could take, as that is just my pet project.

Would read the v3 documentation during those weekends, and will try to migrate it (=

@yuzhva
Copy link
Owner

yuzhva commented Nov 3, 2020

@CodeCutterUK
Copy link
Contributor

I think I have a solution - do you want a PR?

@yuzhva
Copy link
Owner

yuzhva commented Nov 10, 2020

@CodeCutterUK

That would be awesome, as I'm stuck a bit at work.

@Trontor
Copy link

Trontor commented Nov 11, 2020

I think I have a solution - do you want a PR?

Any update on this?

@CodeCutterUK
Copy link
Contributor

Needs some more testing, but works as well as the previous solution

@yuzhva
Copy link
Owner

yuzhva commented Nov 16, 2020

@CodeCutterUK Many thanks for your contribution!

Your PR #124 has been merged and improved at #125

===
@barbalex @Trontor
The latest version with support of react-leaflet v3.0 available as a candidate release:

yarn add react-leaflet-markercluster@next # yarn
npm install react-leaflet-markercluster@next # npm

Hope that will find some time to improve it.

After some testing period will update and republish it as a release package.

Thank you very much 🍻 🍻 🍻

@yuzhva yuzhva added this to the v3.0.0 milestone Nov 16, 2020
@barbalex
Copy link
Author

I tested version 3.0.0-rc1 in my app and it seems to work well. Thanks @CodeCutterUK and @yuzhva !

@agorf
Copy link

agorf commented Nov 19, 2020

The latest version with support of react-leaflet v3.0 available as a candidate release:

yarn add react-leaflet-markercluster@next # yarn
npm install react-leaflet-markercluster@next # npm

@yuzhva Looks like next still points to 2.0.0-rc3 https://www.npmjs.com/package/react-leaflet-markercluster

Or I may be missing something.

(Using @latest works, pulling 3.0.0-rc1)

@yuzhva
Copy link
Owner

yuzhva commented Nov 20, 2020

@agorf
You have been right. The tags were not updated.

✅ Just updated them.

@domhaas
Copy link

domhaas commented Jun 1, 2021

@yuzhva Since latest react-leaflet (v3.2.0) I'm getting this error:
No context provided: useLeafletContext() can only be used in a descendant of <MapContainer>

v3.1.0 is currently working with no issues.

@sebojanko
Copy link

@yuzhva Since latest react-leaflet (v3.2.0) I'm getting this error:
No context provided: useLeafletContext() can only be used in a descendant of <MapContainer>

v3.1.0 is currently working with no issues.

I'm seeing this error on v3.0.4 also.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants