Skip to content

Instantly share code, notes, and snippets.

@ronal2do
Created April 6, 2017 11:41
Show Gist options
  • Save ronal2do/224a5e8e925590c1d3f38d32edb9bc02 to your computer and use it in GitHub Desktop.
Save ronal2do/224a5e8e925590c1d3f38d32edb9bc02 to your computer and use it in GitHub Desktop.
import React, { Component } from 'react';
import {
StyleSheet,
Text,
View,
Image,
} from 'react-native';
import { Root } from './router';
class AppRoot extends Component {
render(){
if ( this.props.auth ) return <Root />
return(
<RootLogin />
)
}
}
}
export default () => <AppRoot />;
@ronal2do
Copy link
Author

ronal2do commented Apr 6, 2017


  render() {
    const { isLoading, token } = this.state;

    if (isLoading) return null;

    console.log('Token  =====>  ', token);
    if (!token) return <Main updateToken={this.updateToken} />;
    return <Main updateToken={this.updateToken} auth />;
  }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment