-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathHomePage.tsx
More file actions
37 lines (31 loc) · 875 Bytes
/
HomePage.tsx
File metadata and controls
37 lines (31 loc) · 875 Bytes
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
import React, { memo } from 'react';
import { Button, StyleSheet, Text, View } from 'react-native';
import { useNav } from 'rnn-hooks';
import { RandomScreen } from '@/src/screens/RnadomScreen';
export const HomePage = memo(() => {
const nav = useNav();
const handlePush = () => {
nav.push(RandomScreen, { color: 'red' });
};
const handleModal = () => {
nav.showModal(RandomScreen, { color: 'green' });
};
return (
<View style={styles.root}>
<Text style={styles.spacing}>Home</Text>
<Button title={'Push Random Screen'} onPress={handlePush} />
<View style={styles.spacing} />
<Button title={'Show Random Modal'} onPress={handleModal} />
</View>
);
});
const styles = StyleSheet.create({
root: {
alignItems: 'center',
flex: 1,
justifyContent: 'center',
},
spacing: {
marginBottom: 12,
},
});