ant-design / cssinjs

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

Missing condition to check if body is loaded at `StyleContext.tsx` #57

Closed bougassaa closed 1 year ago

bougassaa commented 1 year ago

Hello, We are converting our React components to WebComponents (with AntDesign 4 everything worked fine). We've upgraded to V5, and when we build the React components then we include the built file in our sites written in pure HTML (included in the <head>). But as in the screenshot below, an error is detected. I think the condition in file src/StyleContext.tsx:13 is missing the document.body check, this will avoid some issues in the future, as V5 of antd has just been released. I thank you for your work, and for the correction that you could bring 🙏.

Capture d’écran 2022-11-16 à 16 00 01 Capture d’écran 2022-11-16 à 16 00 20
daniele-serfilippi commented 1 year ago

Having the same problem

siamakmontazer commented 1 year ago

I have exactly the same problem