daily pastebin goal
1%
SHARE
TWEET

Untitled

a guest Feb 22nd, 2019 75 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top