LayoutAnimation automatically animates views to their new positions when the next layout happens. A common way to use this API is to call it before calling setState.
On Android, you need to enable LayoutAnimation by setting the following flag in your
UIManager:Methods
configureNext()
object
required
Specifies animation properties:
number
required
Duration of the animation in milliseconds
object
object
function
Callback called when the animation completes. Guaranteed to be called in Fabric renderer.
function
Callback called on error. Only called in Fabric renderer if configuration parsing fails.
create()
configureNext().
number
required
Duration of the animation in milliseconds
string
Animation type:
spring, linear, easeInEaseOut, easeIn, easeOut, or keyboardstring
Property to animate:
opacity, scaleX, scaleY, or scaleXYPreset Methods
easeInEaseOut()
easeInEaseOut preset (300ms duration, opacity property).
linear()
linear preset (500ms duration, opacity property).
spring()
spring preset (700ms duration, spring damping 0.4).
Properties
Types
Available animation types:
Properties
Available animation properties:
Presets
Pre-configured animation presets:
Examples
Basic Usage with setState
Custom Configuration
With Callbacks
Using create() Helper
List Item Addition/Removal
Notes
- Call
LayoutAnimation.configureNext()beforesetState()or other state updates - On Android, LayoutAnimation must be explicitly enabled via
UIManager - Fabric renderer provides more reliable callback support
- Works with layout property changes (width, height, position)
- Does not work with transform properties
- Can impact performance with complex layouts or many simultaneous animations