Even after following guides tailwind still refuses to work on react native.
I have tried many things but this is the simplest approach I have found:
1. npx create-expo-app@latest App --template blank@latest
2. install npm i tailwind-rn
3. npx setup-tailwind-rn
tailwind.config.js
module.exports = {
content: ["./App.{js,jsx,ts,tsx}", "./<custom directory>/**/*.{js,jsx,ts,tsx}"],
theme: {
extend: {},
},
plugins: [],
}
babel.config.js
module.exports = function (api) {
api.cache(true);
return {
presets: ["babel-preset-expo"],
plugins: ["nativewind/babel"],
};
};
App.js
import { Text, View } from 'react-native';
export default function App() {
return (
<View className='flex-1 items-center justify-center'>
<Text>Hello</Text>
</View>
);
}
I would really appreciate some help since this is the only thing blocking me from making any time of app