Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug fixed TextField style error: right operand of 'in' is not an object #3050

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

legend-oe
Copy link

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.

  1. Problem with style Platform.OS === 'web
  2. Problem with style hasValue and centred.

Changelog

Fixed TextField + NativeWind style error

Additional info

@gyanbhartip
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants