Popup menu for react-native based on material android design and iOS ActionSheetIOS. There is no linking required as it is based on the Native android module and ActionSheetIOS.
npm i react-native-simple-popup-menu --save
import SimplePopupMenu from 'react-native-simple-popup-menu'
const items = [
{ id: 'edit', label: 'Edit' },
{ id: 'delete', label: 'Delete' },
];
<SimplePopupMenu
items={items}
style={styles.button}
onSelect={this.onMenuPress}
onCancel={() => console.log('onCancel')}>
<Text>Show menu</Text>
</SimplePopupMenu>
Support for additional cancel label
const items = [
{ id: 'edit', label: 'Edit' },
{ id: 'delete', label: 'Delete' },
];
<SimplePopupMenu
items={items}
style={styles.button}
onSelect={this.onMenuPress}
cancelLabel={'Canćel'}
onCancel={() => console.log('onCancel')}>
<Text>Show menu</Text>
</SimplePopupMenu>
Flow is used as the typing system.
import type {
PopupMenuItem,
} from 'react-native-simple-popup-menu'
{ id?: any, label: string }