Styles are not applied on expo-web
See original GitHub issueDescribe the bug Classnames are applied to html elements however they have no effect on style. I believe it’s related with some versioning. It started to be unavailable after I upgraded couple of packages probably these ones:
"expo": "^46.0.0",
"react-native-web": "~0.18.7"
To Reproduce
I have created a simple repo which I try to change bg color to green which doesn’t work.
https://github.com/suchcodemuchwow/nativewind-error
I have run this command:
expo start --web --https --clear
Expected behavior Styles are applied visually.
Expo Snack If applicable, add a link to an Expo snack demonstrating the issue. There are multiple example snacks available at nativewind.dev. https://snack.expo.dev/@git/github.com/suchcodemuchwow/nativewind-error
Screenshots If applicable, add screenshots to help explain your problem.
Additional context Add any other context about the problem here.
Issue Analytics
- State:
- Created a year ago
- Comments:10 (6 by maintainers)
You are using RNW
0.18
, so NativeWind switches to CSS. You will need to generate your.css
using Tailwind CLI and import it like a normal web project.Ahh, missed that. That fixed me up, I was definitely missing some things. Thanks so much @marklawlor. Congrats on 2.0.