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
2016-02-01 21:50:50 +00:00

33 lines
700 B
JavaScript

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}/>;
}
componentWillMount() {
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;
}}
/>
);
}
};