Test my library outside of example apps #785
Unanswered
Andrew-Paystack
asked this question in
Q&A
Replies: 1 comment 1 reply
-
Hey @atlj , |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hey everyone,
I'm currently stuck on exposing my library to external local apps.
I've done the
npx react-native-builder-bob@latest init
, implemented Native changes in theexamples
folder and both apps work.However, when I try using the library in an external application (i.e. another RN app, that's not the example) the library returns as
undefined
.I did
yarn prepare
and performed a symlink usingnpm link
but still no luck. I can see the library in the appsnode_modules
but it returns "unable to resolve module" errors. I've also tried importing the library viaNativeModules
as shown in RN Docs here.In the
src/index.tsx
file I've added an export to the library.export const myAwesomeLibrary = NativeModules.myAwesomeLibrary ? NativeModules.myAwesomeLibrary : new Proxy( {}, { get() { throw new Error(LINKING_ERROR); }, } );
Any guide on what I'm missing would be really appreciated 🙏
Beta Was this translation helpful? Give feedback.
All reactions