You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Allow access to the "current goal value" of an AnimatedValue.
EDIT: method renamed to getGoalValue, was getEndValue when proposed.
AnimatedValue.getGoalValue(); // the goal value that's currently animating to
Motivation
When writing more complicated animations, sometimes we have to share the same AnimatedValues across multiple/nested components. In addition to .getValue(), it would be super handy if we could also access the "current goal value" via .getGoalValue().
Example
Define a spring in Component A and pass it to Component B.
guopengliang
changed the title
Allow access to spring's "current end value" through AnimatedValue.getEndValue()
Allow access to spring's "current goal value" through AnimatedValue.getGoalValue()
Aug 23, 2019
Since 9.0.0-canary.808.13.719834d, you can use the goal property instead.
style.x.goal
Using .goal is better than .animation.to for two reasons:
Less typing
If your spring is animating toward another spring, .goal will return the current value of the target spring, while .animation.to will return the target spring
🚀 Feature Proposal
Allow access to the "current goal value" of an AnimatedValue.
EDIT: method renamed to getGoalValue, was getEndValue when proposed.
Motivation
When writing more complicated animations, sometimes we have to share the same AnimatedValues across multiple/nested components. In addition to
.getValue()
, it would be super handy if we could also access the "current goal value" via.getGoalValue()
.Example
Define a spring in
Component A
and pass it toComponent B
.Access "current value" as well as "current goal value" from
Component B
.The text was updated successfully, but these errors were encountered: