react-leaflet-google-layer
react-leaflet-google-layer copied to clipboard
Cannot get running with server side rendering
There's something in the setup or use with leaflet which means I can't get this running with server side rendering. apparently window isn't defined
Hi,
Looks like it's a leaflet and react-leaflet issue: https://github.com/PaulLeCam/react-leaflet/issues/45
Another issue is that GoogleMutant (a library which this library depends on) is working with the window object as well:
https://gitlab.com/IvanSanchez/Leaflet.GridLayer.GoogleMutant/blob/master/Leaflet.GoogleMutant.js#L27
I tried using react-leaflet-universal but unfortunately that doesn't work either.
I also tried to do the old set a state value in an useEffect and only render map and tiles etc but that doesn't seem to work either as the window object appears in the compiled dependency code.