Created
October 2, 2017 07:16
-
-
Save ysfzrn/45b5a2264e8681123a2b369af2a49b7e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Navigation } from "react-native-navigation"; | |
import { reaction } from "mobx"; | |
import { registerScreens } from "./registerScreens"; | |
import { observer } from "mobx-react/native"; | |
import Store from "./stores"; | |
registerScreens(); | |
export default class App { | |
constructor() { | |
reaction(() => Store.nav.route, () => this.startApp(Store.nav.route)); | |
Store.nav.appInitialized(); | |
} | |
startApp(root) { | |
switch (root) { | |
case "root": | |
Navigation.startSingleScreenApp({ | |
screen: { | |
screen: "crazySnake.HomeScreen", | |
title: "HOME" | |
} | |
}); | |
return; | |
case "gameScreen": | |
Navigation.startSingleScreenApp({ | |
screen: { | |
screen: "snakeGame.GameScreen", | |
title: "GameScreen" | |
} | |
}); | |
return; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment