Skip to content

Reanimated 4 is stable with CSS animations and transitions

updated

Software Mansion has published the first stable version of Reanimated 4, after a beta and six months of work. The team describes it as the largest release since Reanimated 2 introduced worklets and the UI-thread animation engine built on them.

CSS animations and transitions

The key highlight is a declarative API modeled on CSS animations and transitions. It targets the most common category of animations: those triggered and controlled by state updates rather than by gestures or scroll position. Previously, even a simple animation of this kind needed a shared value plus an animated style worklet.

Software Mansion chose CSS because it is a well-known, complete standard, which should make Reanimated more approachable for web developers and keep React Native developers familiar with those APIs. According to the post, the declarative approach is also easier to optimize, since the library knows up front which attributes of which components are being animated. For state-driven animations, the team recommends adopting the CSS API, which should mean less code (no hook calls) and better performance, with further optimizations planned.

Worklets remain, in a new package

Worklets and shared values are still the recommended tools for more complex cases such as gesture- or scroll-driven animations, screen transitions, and orchestrating multiple derived animations. The authors add that there is no need to rewrite existing code to CSS animations right now.

Since version 3.17, the worklets code lives in a separate package, react-native-worklets, so it can evolve independently and be used by non-animation libraries. For Reanimated users this is an internal dependency, but the installation guide now asks for react-native-worklets/plugin instead of react-native-reanimated/plugin in the Babel configuration. Existing apps can make the switch, though the old plugin path will keep working for the foreseeable future.

Breaking changes

The Reanimated 4 API is described as compatible with Reanimated 3, so most upgrades should need few or no code changes. The main requirement is that the app runs on the React Native New Architecture; once that migration is done, CSS animations can be adopted incrementally.

Other changes include:

  • Removal of rarely used methods that were already deprecated in Reanimated 3.
  • Some now-obsolete methods receive deprecation notices but continue to work as no-ops for backward compatibility.
  • A new default for spring animations. Custom spring settings are still honored.

The original spring implementation mimicked React Native core's and proved overly sensitive to start and end conditions, often misbehaving unless threshold parameters were tuned. The new implementation works without those thresholds, although they are still accepted for backward compatibility. Software Mansion recommends configuring springs with just duration and damping ratio, so an animation finishes at the given time regardless of distance.

Why it matters

For most state-driven UI animations, Reanimated 4 offers a shorter, declarative path that the authors say also performs better, while keeping worklets for interaction-heavy work. The release ties Reanimated firmly to the New Architecture, making that migration a prerequisite for upgrading. A full migration guide and release notes on GitHub cover the details.

Source: swmansion.com