Created
March 14, 2017 03:49
-
-
Save andrewkchan/2041083ccad6eff1c8a7d074c6888042 to your computer and use it in GitHub Desktop.
Root component - renderScene method
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 YourPage from "../components/YourPage"; | |
class Root extends Component { | |
renderScene(route, navigator) { | |
let renderedScene; | |
switch (route.id) { | |
case "dashboard": { | |
renderedScene = ( | |
<Dashboard /> | |
); | |
break; | |
} | |
case "THE_ROUTE_STRING_YOU_DECIDE_TO_GIVE_YOUR_PAGE": { | |
renderedScene = ( | |
<YourPage /> | |
); | |
break; | |
} | |
default: { | |
//... | |
} | |
} | |
//...don't worry about anything below here | |
//... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment