-
Notifications
You must be signed in to change notification settings - Fork 186
/
App3.js
executable file
·68 lines (63 loc) · 1.74 KB
/
App3.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
/**
* Sample React Native App
* https://github.com/facebook/react-native
*
* @format
* @flow
*/
import React, {Component} from 'react';
import {TouchableOpacity, Platform, StyleSheet, Text, View} from 'react-native';
import 'react-native-gesture-handler'
const instructions = '业务3打包的时候依赖了react-navigation,这里展示业务包依赖第三方模块的例子';
type Props = {};
export class App3_1 extends Component<Props> {
render() {
return (
<View style={styles.container}>
<TouchableOpacity onPress={()=>this.props.navigation.push('App3_2')} >
<Text style={[styles.navBtn]}>导航到js页面2</Text>
</TouchableOpacity>
<Text style={styles.welcome}>欢迎来到业务3 页面1的世界!</Text>
<Text style={styles.instructions}>To get started, edit App31.js</Text>
<Text style={styles.instructions}>{instructions}</Text>
</View>
);
}
}
export class App3_2 extends Component<Props> {
render() {
return (
<View style={styles.container}>
<Text style={styles.welcome}>欢迎来到业务3 页面2的世界!</Text>
<Text style={styles.instructions}>To get started, edit App32.js</Text>
<Text style={styles.instructions}>{instructions}</Text>
</View>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#F5FCFF',
},
welcome: {
fontSize: 20,
textAlign: 'center',
margin: 10,
},
instructions: {
textAlign: 'center',
color: '#333333',
marginBottom: 5,
},
navBtn: {
fontSize: 20,
textAlign: 'center',
margin: 40,
padding:15,
backgroundColor: 'red',
borderRadius:6
},
});