Relative Content

Tag Archive for androidreactjsreact-nativehot-reloadmetro-bundler

How to execute a function before a react native app is hot reloaded

The React Native Metro workflow features a ‘r’ reload command at the CLI that reloads the application. It does this in such a way that the componentWillUnmount() process is not invoked like a normal React shutdown in a web browser.
I need a chance to close any resources acquired, like a WebSocket or Audio player.
Related questions that go nowhere, or have no answers
[1] How to execute a function just before a react native app is hot reloaded
[2] How to run a JS funktion before Metro replaces my React Native JS code via “Reload”