Describe the bug
The detectLocale feature is crashing server side rendered apps because window is not available in SSR.
To Reproduce
Steps to reproduce the behavior:
In a SSR app, add detectLocale prop to LitteraProvider.
Attempt building the app.
See error: 'window' is not available during server side rendering.
Expected behavior
Should successfuly build the SSR app.
Potential fix
The bug might be fixed by checking if window is defined. In case it's not, log an error to the console stating detectLocale is not supported in SSR.
Additional context
Reproduced in Gatsby with react-littera@2.2.0.
Describe the bug The
detectLocale
feature is crashing server side rendered apps becausewindow
is not available in SSR.To Reproduce Steps to reproduce the behavior:
detectLocale
prop toLitteraProvider
.'window' is not available during server side rendering.
Expected behavior Should successfuly build the SSR app.
Potential fix The bug might be fixed by checking if
window
is defined. In case it's not, log an error to the console statingdetectLocale
is not supported in SSR.Additional context Reproduced in Gatsby with
react-littera@2.2.0
.