react-native-popup-menu/examples/BasicExample.js

30 lines
702 B
JavaScript
Raw Normal View History

2016-05-18 07:26:58 +00:00
import React from 'react';
import { Text } from 'react-native';
2016-05-16 14:54:39 +00:00
import Menu, {
MenuContext,
MenuOptions,
MenuOption,
MenuTrigger
} from 'react-native-popup-menu';
const BasicExample = () => (
2016-05-19 14:52:19 +00:00
<MenuContext style={{flexDirection: 'column', padding: 30}}>
2016-05-16 14:54:39 +00:00
<Text>Hello world!</Text>
<Menu onSelect={value => alert(`Selected number: ${value}`)}>
<MenuTrigger>
<Text>Select option...</Text>
</MenuTrigger>
<MenuOptions>
<MenuOption value={1}>
<Text>One</Text>
</MenuOption>
<MenuOption value={2}>
<Text>Two</Text>
</MenuOption>
</MenuOptions>
</Menu>
</MenuContext>
);
export default BasicExample;