Can I use react-native link command with a parameter like
react-native link --path "{a_path_to_my_exisiting_ios_or_android_project}"
to link the native code in the node_modules/ to a specific, existing iOS/Android project?
If YES, how to do that and can you document it?
If No, can you add this feature?
Using the manual method for existing projects is error-prone and time-consuming.
What is your project structure? You can do it if automatic detection fails. In that case, I would have to see list of your directories and what you are trying to link.
I have an iOS project, and I add package.json and install node_modules:
.
โโโ Podfile
โโโ Podfile.lock
โโโ Pods/
โโโ helloworld/ ## native code
โย ย โโโ Assets.xcassets/
โย ย โโโ Base.lproj/
โย ย โโโ src/
โโโ helloworld.xcodeproj/
โโโ helloworld.xcworkspace/
โโโ package.json
โโโ node_modules/
โโโ yarn.lock
react-native link work. I want to just run react-native link --ios to link the iOS project only.react-native link doesn't automatically install React-Native-associated native projects including React, RCTAnimation, RCTActionSheet, etc. I need to add those .xcodeproj into our iOS project, and add them to the linked binary in the Build Phases manually.View controller-based status bar appearance to NO manually in the info.plist.I hope I can just install those node modules and simply run react-native link to add the native code to our iOS project.
Hi there! This issue is being closed because it has been inactive for a while. Maybe the issue has been fixed in a recent release, or perhaps it is not affecting a lot of people. Either way, we're automatically closing issues after a period of inactivity. Please do not take it personally!
If you think this issue should definitely remain open, please let us know. The following information is helpful when it comes to determining if the issue should be re-opened:
If you would like to work on a patch to fix the issue, contributions are very welcome! Read through the contribution guide, and feel free to hop into #react-native if you need help planning your contribution.
@xareelee did you find any solution for this?
@hramos is it possible to re-open and add bug label?
I was also disappointedreact-native link command does not link react-native packages. It's much more labor intensive to manually install react-native libraries than external packages.
Current experience: where is RCT.xcodeproj even located? do I need to find a lib too? .. ok build .. nope error .. what is wrong .. google error code .. oh no RCTWebSocket is red color ..
@xareelee you can set a rnpm key in your package.json and define some properties to override defaults.
E.g. here we read properties from an object userConfig.
In order to override location to your .xcodeproj, you'd do:
{ "rnpm": { "ios": { "project": ".../a.xcodeproj" } } }
@grabbou your solution doesn't work
@xareelee did you find any solution for this? I have the same problem
Most helpful comment
@xareelee you can set a
rnpmkey in yourpackage.jsonand define some properties to override defaults.E.g. here we read properties from an object
userConfig.In order to override location to your
.xcodeproj, you'd do: