forked from marcelkalveram/ReactNativeBridge
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.android.js
More file actions
executable file
·41 lines (32 loc) · 1.01 KB
/
Copy pathindex.android.js
File metadata and controls
executable file
·41 lines (32 loc) · 1.01 KB
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
'use strict';
import { NativeModules } from 'react-native';
import createReactClass from 'create-react-class';
module.exports = NativeModules.TCWrapper;
var ReactNat = require('react-native');
var {
AppRegistry,
} = ReactNat;
import { Navigator } from 'react-native-deprecated-custom-components';
import React, { Component } from 'react';
import MyScene from './MyScene';
import MySecondScene from "./MySecondScene";
var TCWithReact = createReactClass({
renderScene(route, navigator) {
if(route.name == 'Main') {
return <MyScene navigator={navigator} {...route.passProps} />
}
if(route.name == 'Home') {
return <MySecondScene navigator={navigator} {...route.passProps} />
}
},
render() {
NativeModules.TCWrapper.initTagCommander(1263, 39);
return (
<Navigator
style={{ flex:1 }}
initialRoute={{ name: 'Main' }}
renderScene={ this.renderScene } />
)
}
});
AppRegistry.registerComponent('TCWithReact', () => TCWithReact);