We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hi,
I try to set up a new react-leaflet component. When I try to access my route, I get an error :
ReferenceError: window is not defined at Object. (.../leaflet/dist/leaflet-src.js:13043:3)
This error is totally fine because Leaflet needs access to the DOM to render properly.
Leaflet makes direct calls to the DOM when it is loaded, therefore this library is not compatible with server-side rendering. (here)
Is it possible to disable server side rendering for a given route ? What are the best practice to do so ?
Thank you :)
EDIT: I check before using my component if I'm on the browser or not. It works but I guess It's not a really nice way to do this... Any clues ?
if(process.title === 'browser'){ //render my component }else { return null }
The text was updated successfully, but these errors were encountered:
I have same problem too with components react-sound and react-ionicons.
react-sound
react-ionicons
Sorry, something went wrong.
No branches or pull requests
Hi,
I try to set up a new react-leaflet component. When I try to access my route, I get an error :
This error is totally fine because Leaflet needs access to the DOM to render properly.
Is it possible to disable server side rendering for a given route ? What are the best practice to do so ?
Thank you :)
EDIT: I check before using my component if I'm on the browser or not. It works but I guess It's not a really nice way to do this... Any clues ?
The text was updated successfully, but these errors were encountered: