David
David

Reputation: 2721

how to get a splash screen first and then go the main home screen when using react-native-navigation?

I am using react-native 0.32.0 and "react-native-navigation": "^1.0.30", And I want to get a splash screen first and then go to the main home screen, where I begin to use react-native-navigation. I googled a lot and did a lot re research but still do not know how to make this. I try to get the simplest config passed to Navigation.startSingleScreenApp, but I still get the navbar in iOS. is it possible to get a raw splash screen first and then use react-native-navigation for navigation?

Upvotes: 0

Views: 681

Answers (1)

coderzzz18
coderzzz18

Reputation: 2615

I implemented this through navigation experimental itself. you can refer this repository on github for navigation experimental https://github.com/jlyman/RN-NavigationExperimental-Redux-Example I used setTimeout() function in the constructor of the page which I am loading first through my navigation experimental. The page in which I used this function became the splash screen of my app. Here is the code.

  class FirstScreen extends Component{   

      constructor(props) {
        super(props);
        setTimeout(this.props.OnChange, 3000); //Constructor of Splash    Screen page
      } 
       //render() code

     }

and here is my onChange() function inside mapDispatchToProps() which is calling navigatePush() action creater of my navigation experimental

        OnChange: () => {
        dispatch(navigatePush('Login'))
        }            

Upvotes: 1

Related Questions