My current problem is that my animation is not activating for the correct id
that was assigned:
anim_star = (id) => {
let progress = this.state.progress;
progress[id] = new Animated.Value(0);
this.setState({ progress });
console.log(this.state.progress);
Animated.timing(this.state.progress, {
toValue: 1,
duration: 2000,
easing: Easing.linear,
}).start();
}
The console
result of that is here:
Where you see the 10: AnimatedValue
, the 10
represents the id
that I clicked on for that animation. For some reason, the animation is not playing for 10
.
Here is my attempt to try and (I guess) append the correct id
to the AnimatedValue
:
<TouchableOpacity
onPress={this.anim_like.bind(this, item.id)}>
<Animation
progress={this.state.progress[item.id]} // Here is where I think I need to fix.
source={require('../Animations/favourite_app_icon.json')}
/>
</TouchableOpacity>
Is there a way to mocked what I have going on in the console.log
?