-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
35 lines (31 loc) · 1.1 KB
/
App.js
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
//@ts-check
import { Toast } from "components";
import RootNavigator from "navigation";
import React, { useEffect, useState } from "react";
import { Provider } from "react-redux";
import { PersistGate } from "redux-persist/integration/react";
import { persistor, store } from "store";
import SplashScreen from "./src/screens/SplashScreen";
// import { Toasty } from "components";
export default function App() {
const [timePassed, setTimePassed] = useState(false);
useEffect(() => {
setTimeout(() => setTimePassed(true), 750);
store.dispatch({ type: "set_playback", payload: false }); // To make sure currentTrack is paused at startup
// if (Text.defaultProps == null) Text.defaultProps = {};
// Text.defaultProps.allowFontScaling = false;
console.disableYellowBox = true;
});
function renderApp(isReady) {
if (isReady && timePassed) {
return <RootNavigator />;
}
return <SplashScreen />;
}
return (
<Provider store={store}>
<PersistGate persistor={persistor}>{renderApp}</PersistGate>
<Toast ref={(ref) => Toast.setRef(ref)} />
</Provider>
);
}