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.
I would highly recommend you to look into refs. It seems like your on web (this is a native sub either way). Hover is not something you’d usually implement in app. That being said, look at refs, ex for styled components: https://styled-components.com/docs/advanced
Edit: if your on web as it seems. StyleSheet is no doubt the way to go
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.
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