Giter Site home page Giter Site logo

testreactnativenativemodule's Introduction

Test React Native, Native Module

This repo was created to demostrate an issue importing from a native android module from a standard react native project.

RNApp was created using react-native init (react-native-cli version 2.0.1) react-native-module created using react-native-create-library https://www.npmjs.com/package/react-native-create-library (version 3.1.2)

Steps to install:

  1. cd RNApp && npm install

Steps to run on android:

  1. cd RNApp && npm run android

Steps to run on iOS:

  1. cd RNApp/ios && pod install && cd ../ && npm run ios

The problem:

In RNApp/App.js

importing the index file from react-native-module

import RNModule from 'react-native-module';

does not work and there is a haste module map error found.

HOWEVER using RNModule from NativeModules does work.

import { NativeModules } from 'react-native';
const { RNModule } = NativeModules;

I have following all the instructions including: clearing haste map module cache, watchman cache, metro bundler cache.

testreactnativenativemodule's People

Contributors

814k31 avatar

Stargazers

Sabyasachi Patra avatar Wasi Sadman avatar Andrea Sessa avatar

Watchers

James Cloos avatar  avatar

Forkers

grisaitis

testreactnativenativemodule's Issues

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.