Skip to content

Conversation

@kkafar
Copy link
Member

@kkafar kkafar commented Oct 22, 2025

Description

No idea why the freeze worked up to 0.81, maybe there was something on
native 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-native replaced ReactFabricHostComponent with ReactNativeElement. This was hidden behind a feature flag until this PR to RN 0.82. The default value for enableAccessToHostTreeInFabric flag has been switched to true.

In the workaround, we relied on internal value of _viewConfig which has been renamed to __viewConfig in ReactNativeElement implementation.

In this PR, we handle all names of this property.

before after
before_3324.mov
after_3324.mov

Fixes https://github.com/software-mansion/react-native-screens-labs/issues/502.

Changes

  • add check for __viewConfig prop name in workaround

Test 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

  • Included code example that can be used to test this change
  • Ensured that CI passes

name

No idea why the freeze worked up to 0.81, maybe there was something on
native 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
Copy link
Member Author

@kkafar kkafar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@kkafar kkafar merged commit dab5b21 into main Oct 22, 2025
3 checks passed
@kkafar kkafar deleted the @kkafar/fix-freeze-unmounting-children branch October 22, 2025 12:00
grahammendick added a commit to grahammendick/navigation that referenced this pull request Oct 24, 2025
Doing this again after React Native 0.82 has broken it again again. Found out [from react native screens](software-mansion/react-native-screens#3324) - they didn't me about it (even though I told [them about the last break](software-mansion/react-native-screens#2778).
Couldn't recreate the problem with tabs - with scenes swipe back recreates. Maybe it's there for completeness or if there's special tabs scenario that can't remember?!
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

Successfully merging this pull request may close these issues.

3 participants