Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup (onDropViewInstance) of React Native Modules on Android not working #243

Open
hohler opened this issue Apr 24, 2023 · 1 comment

Comments

@hohler
Copy link

hohler commented Apr 24, 2023

When RNRestart.Restart() is executed, I need to clean up some custom modules on Android.

With the dev metro server running, it executes onDropViewInstance inside a RN Module ViewManager which extends SimpleViewManager (which extends in the end BaseJavaModule) correctly on restart. So I can destroy some views if needed.

But with a release (or even debuggable) build, but without using the dev server, this function is not called at all (I also checked others like invalidate, onCatalystInstanceDestroy, onHostDestroy, but those won't work).

How can I cleanup stuff inside a module / ViewManager when the app is running standalone without a dev server?

Is this a bug, or why is onDropViewInstance not called?

@freeboub
Copy link

Did you try to use onDestroy in android activity ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants