Skip to content

SwiftUI-based filter content collapses after Fabric view recycling on iOS #57642

Description

@lujjjh

Description

With SwiftUI-based filters enabled, Fabric view recycling can collapse the content inside RCTSwiftUIContainerView.

The outer RCTViewComponentView and _UIHostingView retain their expected height, but the internal SwiftUI hierarchy becomes zero-height.

As a result, the React Native child still has the correct frame but is invisible because its SwiftUI wrapper has zero height.

I reproduced this consistently on the two iOS versions I tested: iOS 16.0 and iOS 26.5. Disabling safe-area handling for the hosting controller fixed the issue on both versions.

Tested on React Native main at commit ad870da.

Steps to reproduce

  1. Clone the reproducer:
    https://github.com/lujjjh/react-native-swiftui-filter-repro/tree/repro/ios-swiftui-filter-recycle
  2. Install dependencies and prepare RNTester for iOS.
  3. Build and launch RNTester.
  4. Open the Playground tab.
  5. Wait approximately 1.5 seconds.

Expected:
The orange content fills the purple 28×28 outline.

Actual:
Only the purple outline is visible because the internal SwiftUI wrapper has zero height.

React Native Version

0.87.0

Affected Platforms

Runtime - iOS, Build - MacOS

Output of npx @react-native-community/cli info

System:
  OS: macOS 26.5.2
  CPU: (18) arm64 Apple M5 Pro
Binaries:
  Node: 26.5.0
  Yarn: 1.22.22
  npm: 11.17.0
Managers:
  CocoaPods: 1.16.2
SDKs:
  iOS SDK: 26.5
IDEs:
  Xcode: 26.6/17F113
Languages:
  Ruby: 2.6.10

Stacktrace or Logs

There is no crash or JavaScript error.

RCTViewComponentView                         28
_UIHostingView<SwiftUIContainerView>         28
_UIInheritedView                              0
PlatformViewHost<UIViewWrapper>               0
UIView wrapper                                0
RCTViewComponentView child                   28

MANDATORY Reproducer

https://github.com/lujjjh/react-native-swiftui-filter-repro/tree/repro/ios-swiftui-filter-recycle

Screenshots and Videos

Image

Activity

  1. react-native-bot commented on Jul 23, 2026

    @react-native-bot
    Collaborator

    Warning

    Could not parse version: We could not find or parse the version number of React Native in your issue report. Please use the template, and report your version including major, minor, and patch numbers - e.g. 0.76.2.

  2. react-native-bot commented on Jul 23, 2026

    @react-native-bot
    Collaborator

    Warning

    Could not parse version: We could not find or parse the version number of React Native in your issue report. Please use the template, and report your version including major, minor, and patch numbers - e.g. 0.76.2.

  3. react-native-bot commented on Aug 17, 2026

    @react-native-bot
    Collaborator

    This issue is waiting for author's feedback since 24 days. Please provide the requested feedback or this will be closed in 7 days.

  4. added
    StaleThere has been a lack of activity on this issue and it may be closed soon.
    and removed
    StaleThere has been a lack of activity on this issue and it may be closed soon.
    on Aug 17, 2026
  5. react-native-bot commented on Sep 10, 2026

    @react-native-bot
    Collaborator

    This issue is waiting for author's feedback since 24 days. Please provide the requested feedback or this will be closed in 7 days.

  6. added
    StaleThere has been a lack of activity on this issue and it may be closed soon.
    on Sep 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions