ant-design / cssinjs

https://ant-design.github.io/cssinjs
MIT License
236 stars 59 forks source link

useHMR throws in SSR when when dev-server hot reloading is enabled #133

Open MaxArtemov opened 11 months ago

MaxArtemov commented 11 months ago
image

https://github.com/ant-design/cssinjs/blob/55d57167648bd916a4fb4b4e48c729c918fb492e/src/hooks/useHMR.ts#L21 In this line, window might be changed to globalThis to support hot reloading in ssr, or add a condition typeof window !== undefined to keep it only hmr'ble on client