How to make a React Native package?
See original GitHub issueI have written some codes that bridge native code to react native, and I want to make it to a package. The project name is RCTRating. RCTRating/package.json is like
{
"name": "react-native-rating",
"version": "0.0.1",
"nativePackage": true,
"scripts": {},
"dependencies": {
"react-native": "^0.11.2"
}
}
And I create a new project “TestRating”, and modify package.json to
...
"dependencies": {
"react-native": "^0.11.2",
"react-native-rating": "file:../RCTRating"
}
And run npm install, the files is coped to node_modules/react-native-rating. Then, I run the code. In the TestRating/node_modules/react-native-rating/index.ios.js, I have
var RCTRatingManager = require('react-native').NativeModules.RCTRatingManager;
RCTRatingManager is undefined
I have a file in TestRating/node_modules/react-native-rating/ios/RCTRatingManager.h
, so it should not be undefined.
Why? Please help me.
Issue Analytics
- State:
- Created 8 years ago
- Comments:7
Top Results From Across the Web
Native Modules NPM Package Setup
Native modules are usually distributed as npm packages, ... native module we will use the community tool called create-react-native-library.
Read more >How to create your own react native npm package - Medium
In this post I will discuss how I created my first react native npm package and how can anyone build their own package....
Read more >How To Create NPM Package For React Native? - MindBowser
We will add one method Ex. · Update example in a custom package · Update version in package. · Update README.md file based...
Read more >How to publish a React Native component to NPM
Publishing is very quick and easy. Just log into your NPM account from the terminal using npm login then publish using npm publish...
Read more >How to develop and publish your react native package to NPM
First, let's create a folder where our React Native component will live. ... Once inside the folder, we need to initialize a new...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@rebeccahughes I’m looking for some official documentation specifying correct way to create a native module library. I have come across this repo https://github.com/frostney/react-native-create-library but I’m not sure if that’s the best way to go about creating a native react native library. Any help would be appreciated. Thanks
Thanks! It’s helpful.