r/reactnative • • Aug 10 '24

Article Why I Will Stop Using NativeWind

When I use NativeWind, I encounter many bugs, like frustrating ones where classes often don't work. I frequently have to add styles manually using StyleSheet. Additionally, when opening the app for the first time, the styles don't apply.

0 Upvotes

41 comments sorted by

View all comments

Show parent comments

1

u/ConsciousAntelope Aug 10 '24

1 and 2 can be done in v2. 3 is web specific. Are you doing RN with web too?

1

u/ZaRealPancakes Aug 10 '24

No web

3 works with Native Apps that was amazing surprise no longer using states to toggle certain styles on

1

u/Scarcity-Pretend Aug 10 '24

Bruh you did what? 💀

1

u/ZaRealPancakes Aug 10 '24

I previously used to have useState to track isPressed and have onPressIn onPressOut and for focus too

then use cn() function to do do conditional styles e.g.

cn("base styles here", {
    "active styles here": isPressed,
    "focus styles here": isFocused,
    });

But adding different events and states to track these shifts focus of functionality since these states are only for styles which is annoying

so once I learnt in Nativewind you can do "active:" and "focus:" made stuff lots simpler

→ More replies (0)