react-native-navigation icon indicating copy to clipboard operation
react-native-navigation copied to clipboard

Android Regression RN 0.73 - `onDropViewInstance` not called anymore, View not cleaned up

Open bvonheid opened this issue 2 years ago • 4 comments

What happened?

With the update to RN 0.73 the onDropViewInstance of ViewManager is not called anymore when a screen is popped from the stack. As stated here for the onDropViewInstance:

Called when view is detached from view hierarchy and allows for some additional cleanup by the ViewManager subclass.

What was the expected behaviour?

onDropViewInstance should be called when a view is popped from the stack.

Was it tested on latest react-native-navigation?

  • [X] I have tested this issue on the latest react-native-navigation release and it still reproduces.

Help us reproduce this issue!

You can reproduce the error in the playground app:

  1. Run 7.38.1 on Android
  2. Attach a Debugger to the App
  3. Set a Breakpoint in the com/facebook/react/uimanager/ViewManager.class file in the onDropViewInstance Method
  4. Click in Layout tab on Stack -> Push -> Pop
  5. => After the Pop onDropViewInstance should be called, but it isn't

With the same steps with 7.37.2 onDropViewInstance is called.

In what environment did this happen?

React Native Navigation version: - React Native version: 0.73 Has Fabric (React Native's new rendering system) enabled: no Node version: - Device model: - Android version: -

bvonheid avatar Feb 21 '24 09:02 bvonheid

any update?

szaboa avatar Jul 04 '24 10:07 szaboa

any workaround then?

szaboa avatar Jul 05 '24 13:07 szaboa

I am not using this navigation library but having a similar issue when working on a native app using embedded React native components. It seems to me that this issue is caused by the changes in React Native 0.73.

Currently, this issue leads to a lot of performance problems in our app due to memory used by native components not getting released when leaving screens.

The way that I'm working around this issue is to downgrade RN to 0.72.15.

tranhoangduong1994 avatar Jul 11 '24 10:07 tranhoangduong1994

Yes we can also confirm that the issue is in React Native 0.73.

szaboa avatar Jul 11 '24 11:07 szaboa

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you believe the issue is still relevant, please test on the latest version and report back. Thank you for your contributions.

stale[bot] avatar Jan 31 '25 23:01 stale[bot]

The issue has been closed for inactivity.

stale[bot] avatar Feb 24 '25 23:02 stale[bot]