Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linking Not Works when adding a native module inside Newly created native module #489

Open
s-jain-cognam opened this issue Feb 16, 2023 · 5 comments

Comments

@s-jain-cognam
Copy link

I have created a native module named x and in which have added some other dependencies which are also native modules (y and z),

On installing the module x in my project. I can see x, y and z are there in my node_modules.

but when in the module x where i have used y and z. they are being shown undefine.

In x i have somewhere used it like

const { RNYModule } = NativeModule;

but value of RNYModule is being given undefined.

Which i understand ny the Y package have not been linked in my root project.

I have also tried installing y and z modules in x as peerDependencies so root project can link it. but it not working also.

@brodycj
Copy link
Owner

brodycj commented Feb 21, 2023

I may need a few weeks to look at this thanks.

@s-jain-cognam
Copy link
Author

Hey just wanted to make sure. does it even this possible that installing another native module(B) into my module(A) can auto link the installed module in project?

I am seeing A gets auto-linked. but can not see B.

Can you please provide me any way to be able to link B to my project (Without project having direct interaction with B)?

@nik6767
Copy link

nik6767 commented Mar 7, 2023

Hello, Any solution on this? facing same issue,
As of now I have to add module B manually, But looking for auto-link solution.

@s-jain-cognam
Copy link
Author

So you added module B manually in module A? can you please tell me how you did? I did tried that also but something must have gone wrong.

@zyestin
Copy link

zyestin commented Dec 14, 2023

A temp solution:

e.g. react-native-remote-font depend on react-native-fs.

Add the code below in file example/ios/Podfile

pod 'RNFS', :path => '../node_modules/react-native-fs'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants