How to hot reload a development package in an Expo app example nested folder?

Hi all,

Is it possible to an Expo app example to load a module located in the parent folder AND to see changes in the example app when i rebuild the package (with tsc -w to rebuild on any saved files)?
I precise that the module is not publish on npm yet.

I’ve already succeed to do that using monorepo architecture with yarn workspaces and expo-yarn-workspaces package.
But what about the case when you don’t want to publish your package like a monorepo?

For example, in this repo GitHub - mrousavy/react-native-vision-camera: 📸 The Camera library that sees the vision.
There is an example RN app in bare workflow and in its package.json there is no mention of the developed package (meaning that it’s not installed like a normal dependency).
But in the app src/App.tsx, the package is used like that :

import { Camera, frameRateIncluded, sortFormatsByResolution, filterFormatsByAspectRatio } from 'react-native-vision-camera';

Though, the react-native-vision-camera is used like it’s already and normally installed with yarn or npm.
How does it work ?


Finally, I’ve found something that works for me.
You can find my config for metro if you want here:

With it, you can access the parent component from the expo app, modify it and immediately see the hot-reload changes.
Create a file metro.config file in your expo root app directory with that code inside:

let config = require('@grean/react-native-metro-config-app-example/index.js');
module.exports = config

For a whole example, you can check this repo out:

Hope it helps.