Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

react-native-popup-menu

// your entry point
import { MenuProvider } from 'react-native-popup-menu';

export const App = () => (
  <MenuProvider>
    <YourApp />
  </MenuProvider>
);

// somewhere in your app
import {
  Menu,
  MenuOptions,
  MenuOption,
  MenuTrigger,
} from 'react-native-popup-menu';

export const YourComponent = () => (
  <View>
    <Text>Hello world!</Text>
    <Menu>
      <MenuTrigger text='Select action' />
      <MenuOptions>
        <MenuOption onSelect={() => alert(`Save`)} text='Save' />
        <MenuOption onSelect={() => alert(`Delete`)} >
          <Text style={{color: 'red'}}>Delete</Text>
        </MenuOption>
        <MenuOption onSelect={() => alert(`Not called`)} disabled={true} text='Disabled' />
      </MenuOptions>
    </Menu>
  </View>
);
Comment

react-native-popup-menu

// your entry point
import { MenuProvider } from 'react-native-popup-menu';

export const App = () => (
  <MenuProvider>
    <YourApp />
  </MenuProvider>
);

// somewhere in your app
import {
  Menu,
  MenuOptions,
  MenuOption,
  MenuTrigger,
} from 'react-native-popup-menu';

export const YourComponent = () => (
  <View>
    <Text>Hello world!</Text>
    <Menu>
      <MenuTrigger text='Select action' />
      <MenuOptions>
        <MenuOption onSelect={() => alert(`Save`)} text='Save' />
        <MenuOption onSelect={() => alert(`Delete`)} >
          <Text style={{color: 'red'}}>Delete</Text>
        </MenuOption>
        <MenuOption onSelect={() => alert(`Not called`)} disabled={true} text='Disabled' />
      </MenuOptions>
    </Menu>
  </View>
);
Comment

PREVIOUS NEXT
Code Example
Javascript :: scroll btn 
Javascript :: scroll up btn 
Javascript :: date picker type react 
Javascript :: simple user agent parse js 
Javascript :: add active in nav 
Javascript :: clean code javascript 
Javascript :: adb.exe: more than one device/emulator react native 
Javascript :: document.getanimation 
Javascript :: how to get promise state in js 
Javascript :: react-native-safe-area-context 
Javascript :: add two float numbers in javascript 
Javascript :: horizontal scrollview in react js 
Javascript :: javascript set element class 
Javascript :: javascript new date undefined 
Javascript :: chain id 
Javascript :: mongodb findoneandupdate return new document 
Javascript :: javascript foreach loop array 
Javascript :: URLSearchParams 
Javascript :: postmark with nodejs 
Javascript :: v-bind shorthand 
Javascript :: how to update state.item[1] in state using setState? React 
Javascript :: create table using jade 
Javascript :: foreach in the elements with a data attibute jquery 
Javascript :: countdown recursion javascript 
Javascript :: absolute price in javascript 
Javascript :: vadd vue router 
Javascript :: modal javascript example 
Javascript :: three dots in javascript 
Javascript :: create a panda component react 
Javascript :: custom indicator js tradingview 
ADD CONTENT
Topic
Content
Source link
Name
7+9 =