Unsupported Tailwind class error
See original GitHub issueI followed the instructions but React Native gives Unsupported Tailwind class error in the console.

App.js:
import { Text, View } from "react-native";
import { StatusBar } from "expo-status-bar";
import utilities from "./tailwind.json";
import { TailwindProvider, useTailwind } from "tailwind-rn";
import React from "react";
export default function App() {
return (
<TailwindProvider utilities={utilities}>
<SomePage />
</TailwindProvider>
);
}
function SomePage() {
const tailwind = useTailwind();
return (
<View style={tailwind("bg-black flex flex-1 justify-center")}>
<Text style={tailwind("text-3xl font-bold text-white")}>hello world</Text>
<StatusBar style="auto" />
</View>
);
}
tailwind.config.js
module.exports = {
content: [],
theme: {
extend: {},
},
plugins: [],
corePlugins: require('tailwind-rn/unsupported-core-plugins'),
}
tailwind.json
{}
Issue Analytics
- State:
- Created a year ago
- Comments:8
Top Results From Across the Web
Unsupported Tailwind class - tailwind.json is empty · Issue #156
I fixed it by setting the content option in my tailwind.config.js and run the command yarn dev:tailwind to watch for changes.
Read more >Why is my Tailwind ract native not changing anything?
It happens because tailwind-rn generates only the CSS it is really needed and everytime you add a tailwind class to an element, ...
Read more >Configuration - Tailwind CSS
A guide to configuring and customizing your Tailwind installation. ... Now all of Tailwind's utility classes will be generated as !important :
Read more >tailwind-rn - Bountysource
I'm getting this error on a typescript project I'm currently working on but also occurs when initing a new typescript project. I think...
Read more >How to use Tailwind CSS in React Native | Lag and Log
Tailwind CSS is an open-source utility-first CSS framework. It redefines the way you style applications by providing a variety of CSS classes by...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
paste this code in tailwind.config.js content: [‘./src/**/*.{js,jsx,ts,tsx}’], this worked for me
check your
tailwind.config.js
file. You may need to changecontent: ['./src/**/*.{js,jsx,ts,tsx}']
tocontent: ['./app/**/*.{js,jsx,ts,tsx}']
depending on your project folder structure. That was the case for me.