Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

React Native LayoutAnimation custom presets

Tags:

react-native

We have predefined presets like this.

LayoutAnimation.configureNext(LayoutAnimation.Presets.linear);

But I did not found a way to use my custom presets for example with linear type and 0.1s speed.

like image 598
rendom Avatar asked Oct 31 '25 21:10

rendom


1 Answers

You can use it like this:

LayoutAnimation.configureNext(CustomAnimation)

with

var CustomAnimation = {
  duration: 400,
  create: {
    type: LayoutAnimation.Types.spring,
    property: LayoutAnimation.Properties.scaleXY,
    springDamping: 0.7
  },
  update: {
    type: LayoutAnimation.Types.spring,
    springDamping: 0.7
  }
}
like image 99
cseelus Avatar answered Nov 03 '25 11:11

cseelus



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!