Skip to content

Instantly share code, notes, and snippets.

@FreddyPoly
Created July 5, 2019 13:22
Show Gist options
  • Save FreddyPoly/3b9dbbe032c9eea126750435d422f27d to your computer and use it in GitHub Desktop.
Save FreddyPoly/3b9dbbe032c9eea126750435d422f27d to your computer and use it in GitHub Desktop.
[REACT NATIVE] Splash App
import "./i18n"
import * as React from "react"
import { AppRegistry } from "react-native"
import { StatefulNavigator } from "./navigation"
import { StorybookUIRoot } from "../storybook"
import { RootStore, setupRootStore } from "./models/root-store"
import { Provider } from "mobx-react"
import { BackButtonHandler } from "./navigation/back-button-handler"
import { contains } from "ramda"
import { DEFAULT_NAVIGATION_CONFIG } from "./navigation/navigation-config"
// ***** ICI *****
import SplashScreen from "react-native-splash-screen"
interface AppState {
rootStore?: RootStore
}
export class App extends React.Component<{}, AppState> {
async componentDidMount() {
// ***** ET LA *****
SplashScreen.hide()
this.setState({
rootStore: await setupRootStore(),
})
}
...
}
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment