-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.ios.js
47 lines (40 loc) · 1 KB
/
index.ios.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
import React from 'react-native'
import RouteList from './src/views/RouteList.js'
import RouteView from './src/views/RouteView.js'
const {Navigator} = React
var {
AppRegistry
} = React
const atthack = React.createClass({
render () {
return <Navigator
style={{
backgroundColor: '333'
}}
initialRoute={{
name: 'Arturito',
route: 'HOME',
extra: {}
}}
renderScene={(currentRoute, navigator) => {
const RouteComponent = Routes[currentRoute.route]
return <RouteComponent
currentRoute={currentRoute}
onBack={navigator.pop}
name={currentRoute.name}
extra={currentRoute.extra}
onChangeRoute={(route, {name, extra}) => {
navigator.push({
name: name,
extra: extra,
route: route
})
}} />
}}/>
}
})
const Routes = {
HOME: RouteList,
ROUTE: RouteView
}
AppRegistry.registerComponent('atthack', () => atthack)