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

Module '"react-leaflet"' has no exported member 'withLeaflet' #993

Closed
omateusamaral opened this issue May 26, 2022 · 3 comments
Closed

Module '"react-leaflet"' has no exported member 'withLeaflet' #993

omateusamaral opened this issue May 26, 2022 · 3 comments

Comments

@omateusamaral
Copy link

Hi I'm trying to import withLeaflet from react-leaflet but not exists. I'm using the version: "react-leaflet": "^3.2.5". any sugestion/help to solve this?

@FranciscoKloganB
Copy link

FranciscoKloganB commented May 29, 2022

withLeaflet is used to be a High Order Component, to use with class-based React. Two things to take note of:

  1. react-leaflet v3 is no longer maintained. See here.
    a. withLeaflet is probably from v2.
    b. I recommend you move to v4.
  2. If you absolutely need to use v3, then, High Order Components are no longer available. Use their hooks instead!
    a. I believe useMap is the hook you are looking for.

@omateusamaral
Copy link
Author

yeah I founded this: #862 (comment) and was what I needed just some adjustment to my component.

@Medmly20208
Copy link

Hi @FranciscoKloganB, I am using react-leaflet@4.2.1 but I still got this error

The requested module '/node_modules/.vite/deps/react-leaflet.js?v=d7daadaf' does not provide an export named 'withLeaflet'

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

No branches or pull requests

4 participants