metro
metro copied to clipboard
feat: add custom event handlers for HMRClient
Summary
Currently there's no API in JavaScript to listen to HMRClient updates. This is problematic if a library wants to replace modules used on JavaScript runtime different than the one created by React Native.
This PR adds a global array of event handlers, HMRClientOnUpdate, which is available very early and which every library can access to obtain HMR updates.
Changelog: [Feature] add custom event handlers for HMRClient
Test plan
I don't know how you'd test this change in the repo. I applied these changes in Reanimated monorepo and everything worked well.