Giter Site home page Giter Site logo

yoboaustin / react-native-dev-menu Goto Github PK

View Code? Open in Web Editor NEW

This project forked from zoontek/react-native-dev-menu

0.0 0.0 0.0 1.37 MB

Add custom items to the React Native dev menu.

License: MIT License

Shell 0.34% JavaScript 6.45% Ruby 16.76% Objective-C 7.93% Java 54.15% TypeScript 8.29% Objective-C++ 6.08%

react-native-dev-menu's Introduction

⚠️ This package is deprecated in favor of DevSettings


📳 react-native-dev-menu

mit licence npm version npm downloads
platform - android platform - ios

Add custom items to the React Native dev menu.
The native part of this module is a variation of react-native-async-storage-dev-menu-item.

Support

Version React Native Support
4.0.0+ 0.61.0+

Setup

$ npm install --save react-native-dev-menu
# --- or ---
$ yarn add react-native-dev-menu

Don't forget to run pod install after that !

🆘  Manual linking

Because this package targets React Native 0.61.0+, you will probably don't need to link it manually. Otherwise if it's not the case, follow this additional instructions:

👀 See manual linking instructions

iOS

Add this line to your ios/Podfile file, then run pod install.

target 'YourAwesomeProject' do
  #
  pod 'RNDevMenu', :path => '../node_modules/react-native-dev-menu'
end

Android

  1. Add the following lines to android/settings.gradle:
include ':react-native-dev-menu'
project(':react-native-dev-menu').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-dev-menu/android')
  1. Add the implementation line to the dependencies in android/app/build.gradle:
dependencies {
  // ...
  implementation project(':react-native-dev-menu')
}
  1. Add the import and link the package in MainApplication.java:
import com.zoontek.rndevmenu.RNDevMenuPackage; // <- add the RNDevMenuPackage import

public class MainApplication extends Application implements ReactApplication {

  // …

  @Override
  protected List<ReactPackage> getPackages() {
    @SuppressWarnings("UnnecessaryLocalVariable")
    List<ReactPackage> packages = new PackageList(this).getPackages();
    // …
    packages.add(new RNDevMenuPackage());
    return packages;
  }

  // …
}

Usage

import DevMenu from "react-native-dev-menu";

if (__DEV__) {
  DevMenu.addItem("Say Hello", () => alert("Hello!"));
}

react-native-dev-menu's People

Contributors

zoontek avatar dependabot[bot] avatar yeomann avatar hanno-jonlay avatar yenbekbay avatar barbosa avatar krisztiaan avatar rwoverdijk avatar svbutko avatar tychota avatar iamolegga avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.