79519057

Date: 2025-03-19 03:33:01
Score: 0.5
Natty:
Report link
  1. npx create-expo-app --example with-nativewind

→ Examples: List of --example starters → Alternative: Tutorial for starter & manual installation by NativeWind

https://www.nativewind.dev/getting-started/installation

  1. Yes, you are correct: Expo handles the babel.config.js behind the scenes and let's you optionally opt-out by simply creating your own file in the root of your app:
// babel.config.js (default)
module.exports = function (api) {
  api.cache(true);
  return {
    presets: ['babel-preset-expo'],
  };
};
// babel.config.js (nativewind)
module.exports = function (api) {
  api.cache(true);
  return {
    presets: [
      ["babel-preset-expo", { jsxImportSource: "nativewind" }],
      "nativewind/babel",
    ],
  };
};

→ You need also to create a metro.config.js if deciding to manually install NativeWind, this file is also handled by Expo behind the scenes and you can opt-out by creating your own file.

Alternative starter & Manual installation guide by NativeWind

Reasons:
  • Probably link only (1):
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Artiphishle