Monday, 13 March 2017

Node modules in react-native

I just tried adding some node modules into react-native. I figure out it will work only with react-native modules and react-native link that modules.

I want to use: - https://www.npmjs.com/package/node-google-image-search or - https://www.npmjs.com/package/first-image-search-load

I tried: Link1 Link2 Link3 Link4

When I'm using command link with "non-react modules" I still get nothing: enter image description here

Also, when I just trying to add this module by:

  1. import 'first-image-search-load'
  2. import {saveFirstImage} from 'first-image-search-load'
  3. import * from 'first-image-search-load'
  4. var first-image-search-load = require('first-image-search-load');
  5. var first-image-search-load = require('./first-image-search-load');
  6. var first-image-search-load = require('./node-modules/first-image-search-load');

and trying put these in index.android.js I get: enter image description here

Please tell me how I can import normal npm plugins into react-native..

Thx



via Darex1991

No comments:

Post a Comment