-
-
Notifications
You must be signed in to change notification settings - Fork 12
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
ClassNames do not work on Nextjs #17
Comments
same here (nextjs) |
@a-eid Which styles are not applied correctly? |
hi @mrzachnugent, as already written in the discord, packages like select or dropdown-menu do not seem to translate the classNames. In your showcase it looks fine, but in a monorepo (or standalone project) with nextjs it doesn't work. e.g. select in your showcase (https://rnr-showcase.vercel.app/select):
in my nextjs example (https://github.com/megacherry/nextjs-rnr):
As you can see, the classNames are not taken over by tailwind, although they are defined in the select component. Thanks for taking the time to watch. |
<SelectPrimitive.Overlay style={[StyleSheet.absoluteFill, {backgroundColor: "#00000050"}]} > |
The Select component was updated to version |
@mrzachnugent perfect, thank you. will be testing it later today. |
This is a Nextjs/webpack issue, it works in an expo project with react-native-web. It seems that the classNames are not being added to react-native-web components from the For example, a primitive with this testing style attribute will work: <DropdownMenuPrimitive.Trigger style={{ $$css: true, test: "bg-blue-500" }} >{/* ... */}</DropdownMenuPrimitive.Trigger> Whereas using Currently investigating. |
I am experiencing the same issue but for expo (no nextjs, no expo web, native only) in a mono repo. Components such as Button, Badge and Text are working fine. Dropdown & Select are not working. Portal (root layout) was added, nativewind is working. Tried your starter, it works there. I tried finding the issue but I can't seem to find it. |
This probably won't help the nextjs users that are experiencing issues, but it might help users that are using the library in a mono repo setup. Issue link: nativewind/nativewind#734 |
@mrzachnugent: Do you know a workaround for this? |
I have the same issue and writing as you said $$css: true, test: "bg-blue-500" works but className doesnt work. Did you find a solution ? |
As a work around, you can copy the primitives into your ~/components/primitives. There's manual instructions on https://rnprimitives.com/ Then in your ~/components/ui files use the import from ~/components/primitives instead of @rn-primitives The devs working on NativeWind have a lot of stuff going on so hopefully after the official release of v4, they'll be able to look into it. |
They do now! You can update your primitives to their latest versions to get it to work with nextjs. |
it's open by default and some styles are not applied correctly. it works fine on android & ios however.
The text was updated successfully, but these errors were encountered: