react-native-ui-lib
react-native-ui-lib copied to clipboard
Bug fixed TextField style error: right operand of 'in' is not an object
Description
If you use rn-ui-lib with NativeWind (Tailwind CSS), TextField not work with error:
ERROR TypeError: right operand of 'in' is not an object
This error is located at:
in CssInteropComponent (created by Incubator.TextField)
in Incubator.TextField (created by TextField)
in RCTView (created by View)
in View
in View (created by TextField)
I found and fixed 2 bugs.
- Problem with style Platform.OS === 'web
- Problem with style hasValue and centred.
Changelog
Fixed TextField + NativeWind style error
Additional info
Could someone please explain why does this fix work? Even if short-circuiting is used, it would return a false instead of undefined (after the solution). But Does react-native not accept false as a value in style array? Why would it fail?