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

29 lines
669 B
JavaScript
Raw Normal View History

2016-05-16 14:54:39 +00:00
import React, { Text } from 'react-native';
import Menu, {
MenuContext,
MenuOptions,
MenuOption,
MenuTrigger
} from 'react-native-popup-menu';
const BasicExample = () => (
<MenuContext style={{flexDirection: 'column'}}>
<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;