forked from byte-up/native-base-starter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.tsx
46 lines (40 loc) · 1.01 KB
/
App.tsx
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
36
37
38
39
40
41
42
43
44
45
46
import { AppLoading } from "expo";
import * as Font from "expo-font";
import React, { Component } from "react";
import { Root } from "native-base";
import { SafeAreaView } from "react-native-safe-area-context";
import MainStackNavigator from "./screens/navigation/MainStackNavigator";
interface IProps {}
interface IState {
loading: boolean;
}
export default class App extends React.Component<IProps, IState> {
constructor(props) {
super(props);
this.state = { loading: true };
}
async componentDidMount() {
await Font.loadAsync({
Roboto: require("native-base/Fonts/Roboto.ttf"),
Roboto_medium: require("native-base/Fonts/Roboto_medium.ttf"),
});
this.setState({ loading: false });
}
render() {
if (this.state.loading) {
return (
<SafeAreaView>
<AppLoading />
</SafeAreaView>
);
} else {
return (
<SafeAreaView>
<Root>
<MainStackNavigator />
</Root>
</SafeAreaView>
);
}
}
}