React-native-web: SSR of styles is broken in 0.11

Created on 13 Mar 2019  路  4Comments  路  Source: necolas/react-native-web

The problem

The css-* styles are missing from all SSR output (except the very first call to AppRegistry.getApplication.

How to reproduce

Record a snapshot of the output in the AppRegistry test for SSR-as-function-of-app.

Expected behavior

All styles should be included in the CSS output.

Environment (include versions). Did this work in previous versions?

  • React Native for Web (version): 0.11

Additional context

Will require treating the css pathway much like the StyleSheet one.

bug

Most helpful comment

@paularmstrong @slorber This branch/PR should fix the issue #1291

All 4 comments

can confirm, I thought I was doing something wrong but yes it seems broken. I had "SSR style flash" with 11. Reverted to 10 and it's fine. (https://gatsby-rnw-todos.netlify.com)

FWIW, you're also using a lot of additional global styles that are going to conflict with the framework's output.

@paularmstrong @slorber This branch/PR should fix the issue #1291

Thanks, will test the fix soon.

@necolas what do you mean by "a lot of global styles"? where do you see that?

I actually added some global styles on html, body, gatsby root div and probably some rnw root div too, but I wouldn't qualify this as a lot. Otherwise I'm using RN inline styles (temporary, will migrate to StyleSheet later, this is just a demo app)

Was this page helpful?
0 / 5 - 0 ratings