You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While migrating a client's app to the new architecture, we noticed that on iOS fabric, whenever a fabric component under Suspense get's suspended (thus display:none was set), our native view components were unmounted (removed and deleted - not just hidden but actually deallocated) and that resulted on their state being lost.
This seems to be a change in behavior to the old arch, where display: none would merely hide the view.
I did a poll among my RN colleagues, and no one expected that the view would be deleted on display: none especially given that you apply that style with the intention to bring the view back after a moment.
Furthermore, the behavior is what we'd expect on Android, where fabric choses to just hide the views (setVisibility(GONE)).
I was wondered if this was added intentionally back then? If so, I think i'd prefer to have a way to either opt-in/out of this behavior (see my PR).
Description
Hi, Ioannis here from Margelo.
While migrating a client's app to the new architecture, we noticed that on iOS fabric, whenever a fabric component under Suspense get's suspended (thus
display:nonewas set), our native view components were unmounted (removed and deleted - not just hidden but actually deallocated) and that resulted on their state being lost.This seems to be a change in behavior to the old arch, where
display: nonewould merely hide the view.I did a poll among my RN colleagues, and no one expected that the view would be deleted on display: none especially given that you apply that style with the intention to bring the view back after a moment.
Furthermore, the behavior is what we'd expect on Android, where fabric choses to just hide the views (
setVisibility(GONE)).I was wondered if this was added intentionally back then? If so, I think i'd prefer to have a way to either opt-in/out of this behavior (see my PR).
Steps to reproduce
cd ReproducerApp && yarn install && cd ios && pod install && cd ..yarn iosdeallocbeing calledReact Native Version
0.85.2
Affected Platforms
Runtime - iOS
Output of
npx @react-native-community/cli infoStacktrace or Logs
None — not a crash. The next render after
displayflips back simply shows a freshly-constructed host view with default state.Reproducer
https://github.com/SudoPlz/reproducer-react-native
Screenshots and Videos
repro.mov