wix / react-native-navigation

A complete native navigation solution for React Native
https://wix.github.io/react-native-navigation/
MIT License
13.05k stars 2.67k forks source link

fix: android onDropViewInstance not invoked when page popped #7919

Open NormanWangEndeavor opened 1 month ago

NormanWangEndeavor commented 1 month ago

What happened?

The onDropViewInstance of ViewManager is not called anymore when a screen is popped from the stack, since RN version 0.71.x.

What was the expected behavior?

The onDropViewInstance of ViewManager should be called.

Was it tested on the latest react-native-navigation?

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

Root Cause

The unmountReactApplication removes all children from RN version 0.71.x which causes the onDropViewInstance not to be called. Adding these removed children back resolves the problem.

In what environment did this happen?

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

related issue: https://github.com/wix/react-native-navigation/issues/7852

maheshwaripurvesh commented 1 month ago

@NormanWangEndeavor Thank you for the quick turnaround. @mobileoss @Niryo @asafkorem I confirm, we can merge this which will resolve #7852

asafkorem commented 1 month ago

@d4vidi / @gosha212 can you please review this?