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

NativeWind errors 😱 #10

Open
aretrace opened this issue Jun 1, 2024 · 3 comments
Open

NativeWind errors 😱 #10

aretrace opened this issue Jun 1, 2024 · 3 comments

Comments

@aretrace
Copy link

aretrace commented Jun 1, 2024

When using NativeWind className, I get the following error:

This error is located at: in CssInterop.Text (created by UITextView) ... ERROR [ERROR: Rendered fewer hooks than expected. This may be caused by an accidental early return statement.]

Current setup:
M1 mac 14.5
node 20.12.2
expo 51.0.8 (default template)
nativewind 4.0.36
react-native-uitextview 1.1.7
ios 17.5

No error when only using StyleSheet. Other react native components are functioning with NativeWind.

@haileyok
Copy link
Collaborator

haileyok commented Jun 1, 2024

huh...I was lazy and put a platform check at the top of a component which does break react rules and could just be move to a parent component, but that's still weird to me. does native wind change the value of Platform.OS for some reason?

can push a fix up for that in a bit, but otherwise there shouldn't be any hook calls.

@haileyok haileyok linked a pull request Jun 2, 2024 that will close this issue
@haileyok haileyok removed a link to a pull request Jun 2, 2024
@haileyok
Copy link
Collaborator

haileyok commented Jun 2, 2024

@aretrace Okay, I removed that in 1.1.8. Could you try that and see if it's helpful at all?

@aretrace
Copy link
Author

aretrace commented Jun 2, 2024

🧐

When I add the uiTextView prop or the selectable prop on UITextView by themselves, UITextView renders className styles as expected. BUT, when both uiTextView and selectable props are on UITextView, all NativeWind className styles do not render (they are completely ignored as if no styles exist).

With StyleSheet, when the uiTextView prop or the selectable prop is applied to UITextView by themselves, StyleSheet functions normally. BUT, when both uiTextView and selectable props are on UITextView, fontWeight is not applied. (I suspect other CSS properties could also not be appropriately rendered or applied by UITextView when both props are used)

previous error no longer appears

@aretrace aretrace changed the title NativeWind error 😱 NativeWind errors 😱 Jun 2, 2024
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

No branches or pull requests

2 participants