marklawlor / nativewind

React Native utility-first universal design system - powered by Tailwind CSS
https://nativewind.dev
MIT License
4.3k stars 233 forks source link

Next.js: styles not working on Native Elements. #851

Closed Knaackee closed 2 months ago

Knaackee commented 2 months ago

At first, thanks for your great work!

I have an Expo/Next.js app.

Next.js Styles are not applied on the react-native-web elements, but on <div/>s it's working.

Expo The styles are getting applied (off course <div/>s don't work on native, but e.g., the Text gets styled)

Example Component:

import { Text, View } from "react-native";

export default function App() {
  return (
    <View>
      <Text className="text-red-700 ">Welcome to Expo + Next.js 👋</Text>
      <div className="this-is-my-class text-3xl text-red-700">This is a div</div>
    </View>
  );
}

Clearly something config related. I played around the whole day.

Any idea?

joaodematejr commented 1 month ago

@Knaackee I have the same problem, could you share the solution?