Closed samiede closed 5 years ago
Investigating. For now a workaround is to reset the animation to default value when your component will unmount.
Put this to your component:
componentWillUnmount() {
this._animatedValue.resetAnimation()
}
I fear that this has something to do with my own implementation because your workaround works exactly once and then doesn’t when going to the screen again
Am 03.05.2019 um 14:12 schrieb Luy Tran notifications@github.com:
Investigating. For now a workaround is to reset the animation https://facebook.github.io/react-native/docs/animatedvalue#resetanimation to default value when your component will unmount.
Put this to your component:
componentWillUnmount() { this._animatedValue.resetAnimation() } — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/octopitus/rn-sliding-up-panel/issues/113#issuecomment-489074724, or mute the thread https://github.com/notifications/unsubscribe-auth/ABOFHOVPDD2DHIV3UCWO4BLPTQTZVANCNFSM4HKTLTTQ.
Update from my side:
I had an @autobind decorator in that screen that apparently caused the behavior. Removing that and binding all functions manually resolved the issue! Thanks!
animatedValue is not working for me at all
animatedValue={top}
renders like bottom
I'm currently experiencing the same issue. My component is correctly initialized the first time but after it will unmount and did mount again (life cycle is the same as the first time), the position isn't correctly initialized the second time even if the state is the same.
Issue Description
I'm setting the initial panel position the following way, it works when using it the first time. After I've changed screen with componentWillUnmount being called, the panel remains in the position I left it in when leaving the screen, even though the constructor is called again and _animatedValue has the correct value.
Steps to Reproduce / Code Snippets / Screenshots
Environment