jfilter / react-native-onboarding-swiper

🛳 Delightful onboarding for your React-Native app
https://www.npmjs.com/package/react-native-onboarding-swiper
Other
986 stars 180 forks source link

Load Page 0 (set an initial state) #77

Open AleMaiaF opened 4 years ago

AleMaiaF commented 4 years ago

Hello, I created a separated page for the SlideShow in my App but if I leave the page and go back to it, the page stays in the last slide I was in instead of going back to the first page. Any idea of how I can set an initial state for the SlideShow to always load it's first page when I go to it? I was trying to implement something like this:

initialState = () => {
  // load page 0 
}

componentDidMount(){ this.load() this.props.navigation.addListener('willFocus', this.load) } load = () => this.initialState(true)