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

How to fix "Uncaught Error: Map container is already initialized.". #16

Open
farz-msv opened this issue Aug 2, 2022 · 3 comments
Open

Comments

@farz-msv
Copy link

farz-msv commented Aug 2, 2022

I have to use two map in one page , in react js .
first map is shown by clicking on a button, when it's closed i have to show second map ,but i have this error , how should i fixed "Uncaught Error: Map container is already initialized."
what should i do?
"next": "12"
"react": "^18.2.0",
"react-neshan-map-leaflet": "^1.2.1",

@ArsHinMQ
Copy link

same error any updates?

@farz-msv
Copy link
Author

Hi
I removed react-neshan-map-leaflet and used react-leaflet. it works.

@mohammad-mo
Copy link

I used dynamic import to fix the error:
const NeshanMap = dynamic(() => import('react-neshan-map-leaflet'), {
ssr: false,
})

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

3 participants