Skip to content
Use native context menus in React Native
Objective-C JavaScript Java Python Ruby
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
android
example
ios
scripts
.gitattributes
.gitignore
.npmignore
README.md
index.js
package.json
react-native-context-menu.podspec
yarn.lock

README.md

react-native-context-menu

Getting started

$ npm install react-native-context-menu --save

Mostly automatic installation

$ react-native link react-native-context-menu

Manual installation

iOS

  1. In XCode, in the project navigator, right click LibrariesAdd Files to [your project's name]
  2. Go to node_modulesreact-native-context-menu and add RnContextMenu.xcodeproj
  3. In XCode, in the project navigator, select your project. Add libRnContextMenu.a to your project's Build PhasesLink Binary With Libraries
  4. Run your project (Cmd+R)<

Android

  1. Open up android/app/src/main/java/[...]/MainApplication.java
  • Add import com.mpiannucci.rncontextmenu.RnContextMenuPackage; to the imports at the top of the file
  • Add new RnContextMenuPackage() to the list returned by the getPackages() method
  1. Append the following lines to android/settings.gradle:
    include ':react-native-context-menu'
    project(':react-native-context-menu').projectDir = new File(rootProject.projectDir, 	'../node_modules/react-native-context-menu/android')
    
  2. Insert the following lines inside the dependencies block in android/app/build.gradle:
      compile project(':react-native-context-menu')
    

Usage

import RnContextMenu from 'react-native-context-menu';

// TODO: What to do with the module?
RnContextMenu;
You can’t perform that action at this time.