You may
One tool that we need react-native-create-library
or, npm install -g react-native-create-library
also, you can find some useful docs on Githubyarn add -g react-native-create-library
“Native modules are usually distributed as react-native-create-library myLib
cd myLib
npm install
An example can be to add a method for android to show the call logs:
Add local dependency
Our next step is to link our native module to package.json in order to have access on what we wrote, open your installed react-native project and create a folder named ‘native’ then copy your native module in the folder created. The next step is to add our dependency in package.json with a file because we link the package from a local project.
Run
or yarn install
to install all our dependencies and navigate to npm install
and look for your native modules if exists. node_modules
To use the code from the native module don’t forget to check README.MD file from the module, there are instructions of how to use it in your react-native project. One more important step after you installed the module with
is to create the symlink with yarn install
.react-native link
Check out how to set up redux for