How to use the react-native-popup-menu.withMenuContext function in react-native-popup-menu

To help you get started, we’ve selected a few react-native-popup-menu examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github instea / react-native-popup-menu / examples / MenuMethodsExample.js View on Github external
import Menu, {
  MenuProvider,
  MenuOptions,
  MenuOption,
  MenuTrigger,
  withMenuContext,
} from 'react-native-popup-menu';

const Openner = (props) => (
   props.ctx.menuActions.openMenu('menu-1')}>
    
  
);

const ContextOpenner = withMenuContext(Openner);

export default class ControlledExample extends Component {

  onOptionSelect(value) {
    alert(`Selected number: ${value}`);
    if (value === 1) {
      this.menu.close();
    }
    return false;
  }

  openMenu() {
    this.menu.open();
  }

  onRef = r => {

react-native-popup-menu

extensible popup/context menu for react native

ISC
Latest version published 2 years ago

Package Health Score

57 / 100
Full package analysis

Similar packages