I set a simple animated value like:
this.state = {
filterOffset = new Animated.Value(0)
}
handleToogle() {
var _toValue = this.state.filterOffset.interpolate({
inputRange: [0, 1],
outputRange: [1, 0]
})
Animated.timing(this.state.filterOffset, {
toValue: _toValue,
duration: 100
}).start()
}
<View onPress={() => this.handleToogle()}>
</View>
Here I want to toggle a view.
I just want to set the value to 0 if 1 and vice versa so that I can apply style accordingly to another animated view.
Is it possible I can set an animated value to animation as a value.
Its not working for me ? Or there any better way to do this