dataesr / react-dsfr

Non-official React components of the official french Système de Design de l'État.
https://dataesr.github.io/react-dsfr/
MIT License
44 stars 22 forks source link

SSR support broken when version > 3.1.12 #290

Closed revolunet closed 1 year ago

revolunet commented 1 year ago

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 commented 1 year ago

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

revolunet commented 1 year ago

Thanks !

github-actions[bot] commented 1 year ago

:tada: This issue has been resolved in version 3.4.9 :tada:

The release is available on:

Your semantic-release bot :package::rocket: