Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add React-Native native module setup dependencies?

I'm very beginner at react-native and I want to create a native module so I followed the official documentation for doing that and in the Native Module Setup but I get confused in the third step where he says "add your newly created module as a dependency in your package.json".

May someon clear that ambiguity and clarify what he means with an example please?

like image 586
Ahmed Salah Avatar asked Oct 20 '25 01:10

Ahmed Salah


1 Answers

I solved by following this https://www.deadcoderising.com/how-to-smoothly-develop-node-modules-locally-using-npm-link/

Assuming you used the default names using the official react native documentation and AwesomeProject and MyLibrary are on the same folder level.

  1. navigate inside AwesomeProject
  2. run "npm link ../MyLibrary/"

And then you can proceed to the next step in the documentation, which is to call "npm install"

like image 77
deggen Avatar answered Oct 21 '25 14:10

deggen



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!