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

SSR support broken when version > 3.1.12 #290

Closed
revolunet opened this issue Oct 28, 2022 · 3 comments · Fixed by #305
Closed

SSR support broken when version > 3.1.12 #290

revolunet opened this issue Oct 28, 2022 · 3 comments · Fixed by #305
Labels

Comments

@revolunet
Copy link
Contributor

Looks like some recent changes introduced some SSR-incompatible code.

I think it comes from window access here : https://github.com/dataesr/react-dsfr/blob/master/src/components/interface/SwitchTheme/SwitchTheme.js#L62

window existence could be tested before access, ex : typeof window!=="undefined" && window.localStorage.getItem("prefers-color-scheme")

@desoindx
Copy link
Collaborator

Released in version 3.4.6, don't hesitate to reopen an issue if the problem comes from another component

@revolunet
Copy link
Contributor Author

Thanks !

revolunet pushed a commit to revolunet/react-dsfr that referenced this issue Nov 29, 2022
revolunet pushed a commit to revolunet/react-dsfr that referenced this issue Nov 29, 2022
desoindx pushed a commit that referenced this issue Dec 1, 2022
github-actions bot pushed a commit that referenced this issue Dec 1, 2022
## [3.4.9](v3.4.8...v3.4.9) (2022-12-01)

### Bug Fixes

* **SwitchMode:** fix SSR fix [#290](#290) ([#309](#309)) ([8fae6c1](8fae6c1))
@github-actions
Copy link

github-actions bot commented Dec 1, 2022

🎉 This issue has been resolved in version 3.4.9 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants