Skip to content

Align expo-tailwind-setup with official Nativewind v5 install docs#101

Draft
danstepanov wants to merge 2 commits into
expo:mainfrom
danstepanov:nativewind-skill-updates
Draft

Align expo-tailwind-setup with official Nativewind v5 install docs#101
danstepanov wants to merge 2 commits into
expo:mainfrom
danstepanov:nativewind-skill-updates

Conversation

@danstepanov

@danstepanov danstepanov commented Jul 4, 2026

Copy link
Copy Markdown

This updates expo-tailwind-setup to match the official Nativewind v5 installation docs and fixes a couple of things that have been generating issue reports.

The skill pinned react-native-css to a specific nightly build. Nightlies go stale, fall behind the React Native peer dependency range, and fail install with ERESOLVE on newer Expo SDKs. The install now uses react-native-css@latest and the nativewind preview dist-tag so it does not go stale again, and there is a troubleshooting entry for the ERESOLVE failure.

The setup steps now follow the official docs: peer deps react-native-reanimated and react-native-safe-area-context are included, Tailwind packages install as dev deps, global.css imports nativewind/theme, the CSS file import step is included with the Fast Refresh warning, lightningcss pinning is shown for each package manager, and the TypeScript section covers the nativewind-env.d.ts triple-slash reference. The metro config is plain withNativewind(config) since the default globalClassNamePolyfill gives className support on all React Native components. The useCssElement wrapper setup that was previously presented as required is still there, reframed as an optional section for projects that disable the polyfill.

It also fixes the brand casing across the repo. The project is stylized Nativewind, with a lowercase w.

I maintain Nativewind, happy to answer any questions.

Replace the pinned react-native-css nightly with @latest. Stale
nightlies fall behind the React Native peer range and fail install
with ERESOLVE on newer Expo SDKs. Point nativewind at the preview
dist-tag instead of a specific preview build for the same reason,
and add a troubleshooting entry covering the ERESOLVE failure.

Also fix the brand casing to Nativewind (lowercase w) throughout.
Match the installation steps to the Nativewind v5 documentation:

- Split the install into runtime deps (nativewind@preview,
  react-native-css@latest, react-native-reanimated,
  react-native-safe-area-context) and dev deps (tailwindcss,
  @tailwindcss/postcss, postcss)
- Add the missing @import "nativewind/theme" to global.css
- Use plain withNativewind(config) with no options; the default
  globalClassNamePolyfill gives className support on all React
  Native components
- Add the missing import-your-CSS-file step with the Fast Refresh
  warning
- Show lightningcss pinning for npm, yarn, pnpm, and bun, with the
  deserialization error it prevents
- Replace the TypeScript section with the nativewind-env.d.ts
  triple-slash reference setup and naming caveats
- Reframe the useCssElement wrapper setup as an optional section
  for projects that disable the polyfill, instead of the default
  path
- Expand troubleshooting to match
@danstepanov danstepanov changed the title Update expo-tailwind-setup versions and Nativewind casing Align expo-tailwind-setup with official Nativewind v5 install docs Jul 4, 2026
@danstepanov danstepanov marked this pull request as draft July 4, 2026 00:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant