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.
By clicking “Sign up for GitHub”, you agree to our
terms of service
and
privacy statement
. We’ll occasionally send you account related emails.
Already on GitHub?
Sign in
to your account
@chayancbnits
swiper must reset him-self on next mount... But if you want to animated slide to initial index (1) before unmount event you can do it by ref. Something like this:
class SwiperWrapper extends React.Component {
swiperRef;
componentWillUnmount() {
this.swiperRef && this.swiperRef.goTo(1);
render() {
return (
<Swiper ref={swiperInstance => this.swiperRef = swiperInstance} from={1}>
</Swiper>
See last chapter of README for details
In my case. All the components are in the same Stack Navigator. So the React Life Cycle Methods does not work for me in Swiper Wrapper Component.
I have make a Workaround by using the React Navigation Event "isFocused" , Something like this:
Is this a better approach?