Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2019
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. import React, { Component } from 'react';
  2. import Login from './Login';
  3. import Splash from './Splash';
  4.  
  5. export default class Root extends Component {
  6. constructor(props) {
  7. super(props);
  8. this.state = { currentScreen: 'Splash' };
  9. setTimeout(() => {
  10. this.setState({ currentScreen: 'Login' });
  11. }, 3000);
  12. }
  13.  
  14. render() {
  15. const { currentScreen } = this.state;
  16. const mainScreen = currentScreen === 'Splash' ? <Splash /> : <Login navigation={this.props.navigation} />
  17. return mainScreen;
  18. }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement