React-native-animatable: Update custom animation

Created on 10 Jun 2017  路  5Comments  路  Source: oblador/react-native-animatable

How can I update custom animation has defined with Animatable.initializeRegistryWithDefinitions?
Example:
Animatable.initializeRegistryWithDefinitions({ rateAnimation: { 0: { color: "#aaa", scale: 1 }, 0.25: { scale: 1.5 }, 0.5: { scale: 1 }, 0.75: { scale: 0.5 }, 1: { color: rateColor, scale: 1 } } });
rateColor changes every render, but rateAnimation never changes. How can I update rateAnimation?

Most helpful comment

Hey, you're probably better of passing this animation as a prop instead.

<Animatable.View animation={{
  0: { color: "#aaa", scale: 1 },
  0.25: { scale: 1.5 },
  0.5: { scale: 1 },
  0.75: { scale: 0.5 },
  1: { color: rateColor, scale: 1 }
}} />

All 5 comments

Hey, you're probably better of passing this animation as a prop instead.

<Animatable.View animation={{
  0: { color: "#aaa", scale: 1 },
  0.25: { scale: 1.5 },
  0.5: { scale: 1 },
  0.75: { scale: 0.5 },
  1: { color: rateColor, scale: 1 }
}} />

@oblador that is great!

Are you on the latest version? The above works locally for me.

@oblador it's working with different style props

Okie, closing this for now then :-)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

patrickml picture patrickml  路  10Comments

dantman picture dantman  路  3Comments

ssomnoremac picture ssomnoremac  路  5Comments

Aspirationtocode picture Aspirationtocode  路  7Comments

EdmundMai picture EdmundMai  路  3Comments