Software Mansion Patrycja Kalinska Mar 11, 2025

How React Native Reanimated Updates Styles: A Deep Dive

Article Summary

Patrycja Kalinska from Software Mansion reveals why React Native Reanimated classifies props into three categories. The reason? Performance optimization that most developers overlook.

React Native Reanimated handles props differently based on whether they trigger layout recalculations. This deep dive explains the distinction between UI props (non-layout), Native props (layout), and JS props, and why understanding this matters for animation performance.

Key Takeaways

Critical Insight

Choosing the right prop type can dramatically speed up React Native animations by avoiding unnecessary layout recalculations.

The article includes a specific code example showing how to animate SVG components that most developers get wrong.

About This Article

Problem

React Native developers had to handle color values inconsistently. Colors like 'black', '#000', and 'rgb(0,0,0)' needed conversion to numbers before the native layer could use them, but other props like opacity didn't require this step.

Solution

Patrycja Kalinska's team at Software Mansion built a custom props allowlist dictionary with UI and Native props. They added the addWhitelistedUIProps function to pull validAttributes from components, so everything works together without extra setup.

Impact

Developers can now animate custom components like react-native-svg's Circle by calling Animated.addWhitelistedNativeProps({r: true}). This removes the need for complex prop configuration while keeping rendering and animation working correctly across different prop types.