Last active
March 11, 2016 08:43
-
-
Save talkol/0f9a73dacbb537afed0b 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
// note: | |
// this code was taken almost as-is from the example project in react-native-controllers/index.ios.js | |
// sorry for mixing es5 and es6 syntax, but it should be very easy to upgrade the syntax here to es6 | |
var Controllers = require('react-native-controllers'); | |
// it's a good idea to separate all react-native-controllers specific code to a single separate file | |
// because we have a special React instance in this file | |
var React = Controllers.hijackReact(); | |
var { | |
ControllerRegistry, | |
TabBarControllerIOS, | |
NavigationControllerIOS, | |
ViewControllerIOS, | |
DrawerControllerIOS | |
} = React; | |
// this is our app controller layout, you can add tabs / side menu drawer | |
var MyApp = Controllers.createClass({ | |
render: function() { | |
return ( | |
<NavigationControllerIOS | |
title="Welcome" | |
component="ExampleScreen" | |
id="main" | |
passProps={{}} | |
/> | |
); | |
}, | |
}); | |
ControllerRegistry.registerController('MyApp', () => MyApp); | |
function startApp() { | |
// this line makes the app actually start and initialize | |
ControllerRegistry.setRootController('MyApp'); | |
} | |
module.exports = startApp; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment