1

I created a library using react-native-builder-bob, if I publish or pack it I am able to use it on Expo as expected.

However, I want to test changes on my library without having to go through the publish/pack cycle.

I did:

  1. yarn link on the library module
  2. yarn link <libary-module> on the expo code

But when the app runs or I do expo export it can't find the module.

Unable to resolve module @myorg/react-native-ui from
 /Users/trajano/p/myapp/root/RootUi.tsx: @myorg/react-native-ui could not
 be found within the project or in these directories:
  node_modules
   5 |   StatusBar,
   6 |   Translations,
>  7 | } from "@myorg/react-native-ui";
     |         ^

Am I missing a step somewhere?

I tried updating watchFolders in metro.config.js but because my library has peer dependencies it can't find the peer dependency when I start up.

SMALL UPDATE: I also have an added complication that the library needs to be compatible with Expo 44 and Expo 45. So the devDependency on the library is different than that of the code.

I would also like to avoid packing as workaround.

Archimedes Trajano
  • 35,625
  • 19
  • 175
  • 265

0 Answers0