transitionBehavior
transitionBehavior lets you determine whether the transition is applied to discrete properties. Defaults to normal which transitions only continuous properties and discards discrete properties.
Reference
function App() {
return (
<Animated.View
style={{
transitionProperty: 'alignItems',
transitionDuration: 500,
transitionBehavior: 'allow-discrete',
}}
/>
);
}


Type definitions
type CSSTransitionBehavior = 'normal' | 'allow-discrete';
Values
allow-discrete
Allows transitions to be applied to discrete properties, resulting in delayed changes.
normal
Doesn't allow transitions to be applied to discrete properties, resulting in changes applied immediately.
Example
Remarks
-
Discrete style properties (like
flexDirection,justifyContent) can't be smoothly animated using thetransitionPropertyproperty. For example, you can't animate smoothly fromalignItems: starttoalignItems: center. You can use Layout Animations to animate discrete style properties instead. -
When using
allow-discretethe discrete properties flip between two values at the midpoint of the animation, except for thedisplayproperty, which is immediately at the moment of the transition start.
Platform compatibility
| Android | iOS | Web |
|---|---|---|
| ✅ | ✅ | ✅ |