This repository has been archived on 2023-03-26. You can view files and clone it, but cannot push or open issues or pull requests.
Sphere/app/components/app.js

34 lines
700 B
JavaScript
Raw Normal View History

2016-02-01 20:58:00 +00:00
import React from 'react-native';
import RouteMaster from './routes/RouteMaster';
const {
Navigator,
} = React;
export default class extends React.Component {
renderScene(route, nav) {
const props = route.props || {};
return <route.component nav={nav} {...props}/>;
}
2016-02-01 21:50:50 +00:00
componentWillMount() {
2016-02-01 20:58:00 +00:00
this.initialRoute = RouteMaster.get('LOGIN');
}
render() {
return (
<Navigator
renderScene={this.renderScene}
initialRoute={this.initialRoute}
configureScene={(route) => {
if (route.sceneConfig) {
return route.sceneConfig;
}
return Navigator.SceneConfigs.PushFromRight;
}}
/>
);
}
};