fix: prevent freeze from unmounting native components #3324
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
No idea why the freeze worked up to 0.81, maybe there was something onnative side that prevented children from being unmounted and it is no
longer there. Our fix did not work, however. This commit fixes it.
Name of the filed has been changed here:facebook/react-native@a36dbae@kligarski:
Starting from RN 0.82, our workaround that prevented unmounting frozen views has stopped working - the bug is very similar to one described here. The details of the workaround are available here.
Due to introduction of DOM APIs,
react-nativereplacedReactFabricHostComponentwithReactNativeElement. This was hidden behind a feature flag until this PR to RN 0.82. The default value forenableAccessToHostTreeInFabricflag has been switched totrue.In the workaround, we relied on internal value of
_viewConfigwhich has been renamed to__viewConfiginReactNativeElementimplementation.In this PR, we handle all names of this property.
before_3324.mov
after_3324.mov
Fixes https://github.com/software-mansion/react-native-screens-labs/issues/502.
Changes
__viewConfigprop name in workaroundTest code and steps to reproduce
Run
Test1726. Go to screen 3 and go back via native back button. Customization of back button on the second screen should be still visible.Checklist