This is a new React Native project, bootstrapped using @react-native-community/cli
.
# using command
cd android
./gradlew clean
./gradlew --stop
# using command
yarn add nativewind
yarn add --dev [email protected]
npx tailwindcss init
Create file nativewind-env.d.ts
// nativewind-env.d.ts
/// <reference types="nativewind/types" />
In file babel.config.js
module.exports = {
presets: ['module:@react-native/babel-preset'],
plugins: ["nativewind/babel"] // Add this line
};
In file tailwind.config.js
// tailwind.config.js
/** @type {import('tailwindcss').Config} */
module.exports = {
content: ["./src/**/*.{js,jsx,ts,tsx}"],
theme: {
extend: {},
},
plugins: [],
}
To learn more about React Native, take a look at the following resources:
@facebook/react-native
- the Open Source; GitHub repository for React Native.