forked from instea/react-native-popup-menu
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNonRootExample.js
More file actions
28 lines (26 loc) · 791 Bytes
/
NonRootExample.js
File metadata and controls
28 lines (26 loc) · 791 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
import React from 'react';
import { Text, View } from 'react-native';
import Menu, {
MenuProvider,
MenuOptions,
MenuOption,
MenuTrigger,
} from 'react-native-popup-menu';
const NonRootExample = () => (
<View style={{padding: 60, flex:1}}>
<MenuProvider style={{flexDirection: 'column'}}>
<Text>Hello world!</Text>
<Menu onSelect={value => alert(`Selected number: ${value}`)}>
<MenuTrigger text='Select option' />
<MenuOptions>
<MenuOption value={1} text='One' />
<MenuOption value={2}>
<Text style={{color: 'red'}}>Two</Text>
</MenuOption>
<MenuOption value={3} disabled={true} text='Three' />
</MenuOptions>
</Menu>
</MenuProvider>
</View>
);
export default NonRootExample;