https://www.freecodecamp.org/news/tailwindcss-in-react-native-expo/

설치

npm 또는 yarn으로 설치

npm install -g expo-cli
cd 프로젝트명
npm i nativewind
npm i --dev [email protected]

or

yarn global add expo-cli
cd 프로젝트명
yarn add nativewind
yarn add --dev [email protected]

npx tailwindcss init

tailwindconfig.js

/** @type {import('tailwindcss').Config} */
module.exports = {
  content: [
    "./App.{js,jsx,ts,tsx}",
    "./<custom directory>/**/*.{js,jsx,ts,tsx}",
  ],
  theme: {
    extend: {},
  },
  plugins: [],
};

babel.conf.js

module.exports = function (api) {
  api.cache(true);
  return {
    presets: ['babel-preset-expo'],
    plugins: ["nativewind/babel"],
  };
};


사용