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
{{ message }}
Repository navigation
How to handle animation style properties correctly #26
I needed to use an animatedValue for some fading animation.
The thing is that the animated component like AnimatedView etc have soem kind of magic to detect the animated properties and optimize it (more that a simple forceUpdate say the documentation).
this.state.anim.addListener(onValueChange);
function onValueChange(v:{value:Float}) {
this.forceUpdate();
}
That would be quite inelegant to change all the props so that they can be defined as animatable, so maybe we can do something else ? (abstract somewhere ?)
What's your ideas? @kevinresol @back2dos @zabojad
here is one way to get it, a bit dirty but it works: here you have both styles inlined <AnimatedView style=${cast ([styles.main, {opacity: anim}]:Array<Dynamic>)}>
Activity
kevinresol commentedon Jan 16, 2019
I think
AnimatedViewshould have its ownPropsinstead of usingView's one.serjek commentedon Jun 6, 2019
here is one way to get it, a bit dirty but it works: here you have both styles inlined
<AnimatedView style=${cast ([styles.main, {opacity: anim}]:Array<Dynamic>)}>