I tried to do it, but changing initialPosition has no effect. How can this be done? Can the position be animated? This is important for many applications.
Thanks!
You can use imperative SnapTo method (take a look on issue #44)
Hi guys, I tried to call snapTo method in "ComponentDidMount" eg. this.refs['menuInstance'].snapTo({index: index}), but it does not trigger the snap. I was wondering if this is even possible to do? Thanks!
@Blackmamba23 having the same problem. seems like Intractable.View methods are not called in componentDidMount.
At some cases, they are not even called in componentDidUpdate either.
I'm still investigating the bug, not sure if it's supposed to be like this or it's a bug.
Try to make your changes on onLayout
<Intractable.View
onLayout = {() => this.handleAnimation() }
ref = {ref => this.animatedViewRef = ref}
.....
</Intractable.View>
handleAnimation() {
this.animatedViewRef.snapTo({index:1})
}
Thank you @kevinNejad
Most helpful comment
Hi guys, I tried to call snapTo method in "ComponentDidMount" eg. this.refs['menuInstance'].snapTo({index: index}), but it does not trigger the snap. I was wondering if this is even possible to do? Thanks!