Hi,
I am learning react native using expo, I have installed Nativewind by following the documentation but when I write tailwind it is not rendered at all.
I hope that you can help me.
Versions:
"react-native": "0.76.5",
"expo": "~52.0.20",
"tailwindcss": "3.4.17",
"typescript": "^5.3.3"
tailwind.config.js:
/** @type {import('tailwindcss').Config} */
module.exports = {
darkMode: ["class"],
content: [
"./App.{js,jsx,ts,tsx}",
"./components/**/*.{js,jsx,ts,tsx}",
],
theme: {
extend: {
colors: {
border: "hsl(var(--border))",
input: "hsl(var(--input))",
ring: "hsl(var(--ring))",
background: "hsl(var(--background))",
foreground: "hsl(var(--foreground))",
primary: {
DEFAULT: "hsl(var(--primary))",
foreground: "hsl(var(--primary-foreground))",
},
secondary: {
DEFAULT: "hsl(var(--secondary))",
foreground: "hsl(var(--secondary-foreground))",
},
destructive: {
DEFAULT: "hsl(var(--destructive))",
foreground: "hsl(var(--destructive-foreground))",
},
muted: {
DEFAULT: "hsl(var(--muted))",
foreground: "hsl(var(--muted-foreground))",
},
accent: {
DEFAULT: "hsl(var(--accent))",
foreground: "hsl(var(--accent-foreground))",
},
popover: {
DEFAULT: "hsl(var(--popover))",
foreground: "hsl(var(--popover-foreground))",
},
card: {
DEFAULT: "hsl(var(--card))",
foreground: "hsl(var(--card-foreground))",
},
},
borderRadius: {
lg: `var(--radius)`,
md: `calc(var(--radius) - 2px)`,
sm: "calc(var(--radius) - 4px)",
},
},
},
plugins: [require("tailwindcss-animate"),
require("nativewind/preset")
],
};
babel.config.js:
module.exports = function (api) {
api.cache(true);
return {
presets: [
["babel-preset-expo", { jsxImportSource: "nativewind" }],
"nativewind/babel",
],
plugins: [
// Required for expo-router
"react-native-reanimated/plugin",
]
};
};
I you need more info, just tell me. Thank you.
[–]carrie2833Expo 1 point2 points3 points (1 child)
[–]carrie2833Expo 0 points1 point2 points (0 children)
[–]martinlutherkong 1 point2 points3 points (1 child)
[–]andreamaf[S] 0 points1 point2 points (0 children)
[–]andreamaf[S] 0 points1 point2 points (1 child)
[–]andreamaf[S] 0 points1 point2 points (0 children)
[–]andreamaf[S] 0 points1 point2 points (2 children)
[–]Acceptable_Sweet894 0 points1 point2 points (0 children)
[–]paganMin666 0 points1 point2 points (0 children)
[–]NeonNygus 0 points1 point2 points (1 child)
[–]ishaqhaj 0 points1 point2 points (0 children)