Skip to content

Commit c673ed0

Browse files
committed
Add Login 3 component with different PopTo examples
1 parent 78c849e commit c673ed0

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

Example/components/Login3.js

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
import React from 'react';
2+
import {View, Text, StyleSheet} from "react-native";
3+
import Button from "react-native-button";
4+
import {Actions} from "react-native-router-flux";
5+
6+
const styles = StyleSheet.create({
7+
container: {
8+
flex: 1,
9+
justifyContent: "center",
10+
alignItems: "center",
11+
backgroundColor: "#F5FCFF",
12+
},
13+
});
14+
15+
const popToRoot = () => {
16+
Actions.popTo("root");
17+
}
18+
19+
const popToLogin1 = () => {
20+
Actions.popTo("loginModal");
21+
}
22+
23+
const popToLogin2 = () => {
24+
Actions.popTo("loginModal2");
25+
}
26+
27+
export default class extends React.Component {
28+
render(){
29+
return (
30+
<View style={styles.container}>
31+
<Text>Login2 page: {this.props.data}</Text>
32+
<Button onPress={Actions.pop}>Back</Button>
33+
<Button onPress={popToLogin1}>To Login</Button>
34+
<Button onPress={popToLogin2}>To Login2</Button>
35+
<Button onPress={popToRoot}>To Root</Button>
36+
</View>
37+
);
38+
}
39+
}

0 commit comments

Comments
 (0)