Next.js Discord

Discord Forum

React-leaflet limitations

Answered
Lakeland Terrier posted this in #help-forum
Open in Discord
Lakeland TerrierOP
I am looking at interactive js mapping libraries for my nextjs project. In the react-leaflet docs ( https://react-leaflet.js.org/docs/start-introduction/ ) it states: "Leaflet makes direct calls to the DOM when it is loaded, therefore React Leaflet is not compatible with server-side rendering."

Does that mean it is not compatible at all with next15/react19? Or does that just mean the map will always be in a "use client" situation?

If anyone else has opinions of a better react interactive map solution I would love to hear it. I am trying to avoid building an interactive map from scratch.
Answered by Lakeland Terrier
I guess https://d3js.org/ is going to be better for me I think
View full answer

2 Replies

Lakeland TerrierOP
I guess https://d3js.org/ is going to be better for me I think
Answer
Tomistoma
Hey I'm not sure what you ended up going with here. But from what I've seen elsewhere, and use myself, it means the map is client-side and you just need to do a special dynamic import with SSR off when importing it. I've gotten react-leaflet maps working