Wildhoney/ReactShadow

Styled-components not working in production

laurentC35 opened this issue · 3 comments

Hello,
I use react-shadow/styled-components and styled-components to style my react components.
When I use yarn start (react-scripts start), it works well.
But I build the app with yarn build (react-scripts build), it doesn't seem to be working anymore.
With dev-tools I can see the style tag, but it is empty.

react-shadow: 18.1.0
styled-components: 5.0.1

Navigator : on chrome and firefox (last-version)

Maybe I'm misusing both packages ?
Thanks

Hmm that's a tough one to debug without seeing the code. Is the style tag an immediate descendant of the shadow root?

Hello again,

Yes the style tag is an immediate descendant of the shadow root.
I found finally a solution, I needed to call two times ReactDOM.render(<App/>, ...), I've found a more elegant alternative. (with only one call to ReactDOM.render(<App/>, ...) ).

So the problem was the double-calling of this method. Sorry ;)

Hmm why do you need to double call? Sounds like you're having a problem elsewhere, if you can describe the issue you're having, maybe I can help.