/** @type {import('tailwindcss').Config} */
module.exports = {
content: ["./App.{js,jsx,ts,tsx}", "./components/**/*.{js,jsx,ts,tsx}", "./screens/**/*.{js,jsx,ts,tsx}"],
theme: {
extend: {},
},
plugins: [],
corePlugins: require('tailwind-rn/unsupported-core-plugins'),
};
const { getDefaultConfig } = require('metro-config');
module.exports = (async () => {
const {
resolver: { sourceExts, assetExts }
} = await getDefaultConfig();
return {
transformer: {
babelTransformerPath: require.resolve('react-native-babel-transformer')
},
resolver: {
assetExts: assetExts.filter(ext => ext !== 'svg'),
sourceExts: [...sourceExts, 'svg', 'jsx', 'js', 'ts', 'tsx'],
}
};
})();
Check Your content (Purge) Configuration:
- In your
tailwind.config.js, carefully define the files that Tailwind should scan for class names. A common mistake is to not include all your components. Be specific.
content: [
"./App.{js,jsx,ts,tsx}",
"./components/**/*.{js,jsx,ts,tsx}",
"./screens/**/*.{js,jsx,ts,tsx}",
],
If you can provide a specific example of a component where NativeWind is not working as expected, I can give you more tailored advice. Please share the component's code and describe the styling issue you're seeing.