npm nativewind 5.0.0-rc.2
Release 5.0.0-rc.2

one hour ago

rc.2 breaking changes

Note: this only applies to users on an older pre-release version of Nativewind v5.

Users of v4 are unaffected except by one edge-case: skew + scale-<axis>; see nativewind/react-native-css#576

We've changed how some CSS rules get applied. In most usage we've seen, these are niche edge-cases; otherwise, you may have already been working around the v5 behavior, as the rules were applied incorrectly.

Impact

Usage of the following classNames on elements with children:

  • from-*, to-*, via-*
  • border-<style>, outline-<style>
  • shadow-<color|size>, drop-shadow-<color|size>, inset-shadow-<color|size>
  • ring, ring-<color|n>, ring-offset-*, ring-inset, inset-ring-<color|n>
  • leading-*
  • translate-*, scale-*, rotate-<axis>-*, skew-*
  • blur-*, brightness-x, contrast-*, grayscale, hue-rotate-*, invert, saturate-*, sepia
  • duration-*, ease-*

CSS variables set by these classes no longer incorrectly leak to descendents. The CSS variables were only relevant when using a similar className that reads that CSS variable. For more info, see nativewind/react-native-css#567.

Usage of the following classNames in combination with scale-<axis>-*:

  • translate-*, scale-*, rotate-*, skew-*, transform-*

Styles from these classes now apply in the same order as the browser. For more info, see nativewind/react-native-css#576

Usage of the following classNames hitting an Android TextInput:

  • py-*, px-*

Android TextInput's will lose additional padding it incorrectly had. For more info, see nativewind/react-native-css#580

Usage of the following className variants in general:

  • placeholder:*, selection:*

These classes no longer depend on the order they are written. For more information, see nativewind/react-native-css#432

Finding affected code

You can use the nativewind-v5-rc2 skill to find places you are affected. To add it to your project:

npx skills add nativewind/nativewind --skill nativewind-v5-rc2

Then, you can point your agent to it. It's prompted to ask you before applying any fixes.

If you don't want to use an agent, it's powered by a script that finds potential issues that you can use directly:

node skills/nativewind-v5-rc2/scripts/scan.mjs /absolute/path/to/app

Why

Every case either fixes a regression from Nativewind v4, or in the case where v4 did not support a particular feature, brings it more in line with browser behavior that users expect.

This is necessary for two reasons:

  • Users that upgrade from Nativewind v4 do not undergo breaking changes, especially when those changes take us farther from the web.
  • Users (and agents) that are accustomed to web behavior should expect the same on mobile.

Thank you for helping test and stabilize Nativewind v5. Now, go build something beautiful.

Nativewind 5.0.0-rc.2

Nativewind 5.0.0-rc.2 pairs with react-native-css 4.0.0-rc.1 for Expo SDK 58: Expo 58.1.0, React Native 0.88.1, React 19.3.0, Reanimated 4.7.1 and Worklets 0.13.0. Nativewind preview and rc select this candidate; latest remains on v4.

Upgrade both packages together, because Nativewind pins the exact engine version:

npm install --save-exact nativewind@5.0.0-rc.2 react-native-css@4.0.0-rc.1

Changes

  • require react-native-css 4.0.0-rc.1, and disable its compiler warnings by default (#1897)
  • add Switch thumb-* and track-* color utilities (#1894)
  • map tint-* utilities to native props (#1839)
  • add the nativewind-v5-rc2 skill to find code affected by these changes (#1899)

See the engine release notes for the engine changes behind the breaking changes above.

Full changes: 5.0.0-rc.1...613d86f

Don't miss a new nativewind release

NewReleases is sending notifications on new releases.