-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.js
More file actions
35 lines (27 loc) · 870 Bytes
/
Copy pathApp.js
File metadata and controls
35 lines (27 loc) · 870 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import React, { Component } from 'react';
import SplashScreen from 'react-native-splash-screen';
import RegisterMain from './src/components/pages/RegisterMain';
import MainApp from './MainApp';
import AsyncStorage from '@react-native-community/async-storage';
import {
USER_DATA,
} from './constants/routesAPI';
export default class App extends Component<Props> {
constructor(props) {
super(props);
this.state = {
userData: null,
}
AsyncStorage.getItem(USER_DATA).then((value) => {
this.setState({userData: value});
});
}
componentDidMount() {
setTimeout(() => {SplashScreen.hide()}, 3000);
}
render() {
const register = <RegisterMain />;
const mainApp = <MainApp />;
return (this.state.userData ? mainApp : register);
}
}