'use strict'; // original example from https://raw.githubusercontent.com/jaysoo/react-native-menu/master/Example/Example.js const React = require('react'); const RN = require('react-native'); const { ScrollView, StyleSheet, Text, View } = RN; import Menu, { MenuContext, MenuOptions, MenuOption, MenuTrigger } from 'react-native-popup-menu'; const OriginalExample = React.createClass({ componentDidMount() { // We can use the public context API to open/close/toggle the menu. //setInterval(() => { // this.refs.MenuContext.toggleMenu('menu1'); //}, 2000); }, getInitialState() { return { message: 'Try clicking the top-right menus', firstMenuDisabled: false, dropdownSelection: '-- Choose --' }; }, setMessage(value) { if (typeof value === 'string') { this.setState({ message: `You selected "${value}"` }); } else { this.setState({ message: `Woah!\n\nYou selected an object:\n\n${JSON.stringify(value)}` }); } return value !== 'do not close'; }, setFirstMenuDisabled(disabled) { this.setState({ message: `First menu is ${disabled ? 'disabled' : 'enabled'}`, firstMenuDisabled: disabled }); }, render() { return ( // eslint-disable-next-line react/no-string-refs OPEN FIRST MENU Normal option Does not close menu Disabled option Option with object value OPEN SECOND MENU { this.state.firstMenuDisabled ? ( enable first menu ) : ( disable first menu ) } { this.state.message } You can also make it a dropdown this.setState({ dropdownSelection: value })}> {this.state.dropdownSelection} CHOOSE SOMETHING....{options}}> Option One Option Two Option Three Option Four Option Five ); } }); const styles = StyleSheet.create({ topbar: { flexDirection: 'row', justifyContent: 'flex-end', backgroundColor: 'black', paddingHorizontal: 5, paddingVertical: 10 }, menuTrigger: { flexDirection: 'row', paddingHorizontal: 10 }, menuTriggerText: { color: 'lightgrey', fontWeight: '600', fontSize: 20 }, disabled: { color: '#ccc' }, divider: { marginVertical: 5, marginHorizontal: 2, borderBottomWidth: 1, borderColor: '#ccc' }, content: { backgroundColor: 'white', paddingHorizontal: 10, paddingTop: 20, paddingBottom: 30, borderBottomWidth: 1, borderColor: '#ccc' }, contentText: { fontSize: 18 }, dropdown: { width: 300, borderColor: '#999', borderWidth: 1, padding: 5 }, dropdownOptions: { marginTop: 24, margin: -6, borderColor: '#ccc', borderWidth: 2, width: 300, height: 200 } }); module.exports = OriginalExample;