Skip to content

[iOS][interoplayer] not handling adding children correctly #51212

Closed
@chrfalch

Description

@chrfalch

Description

When adding children in a native view that uses the interop layer under Fabric, insertion of children aren't handled correctly. In the example below the yellow view is a native view with no extra features or functionality. The blue squares are regular views. Each square is added to the state when pressing the "Add Square"-button. This is a snapshot after adding 5 squares.

Paper:

Fabric:

Observe that under Fabric only 4 squares are rendered. If you add these children on mount, all children are displayed correctly, so this happens only when adding children to an already mounted native view.

Possible problem

This seems to be related to the order of which the RCTLegacyViewManagerInteropComponentView new child views are added, where mountChildComponentView is called without calling finalizeUpdates after the children was added to the list of children being mounted.

Steps to reproduce

  1. Download the reproduction app running RN 0.79.2 here: https://github.com/chrfalch/interoplayer-repro
  2. Build and run (defaults to the new architecture
  3. Press the "Add Square" button
  4. Observe that the first new child is only visible in the regular view section

React Native Version

0.79.2

Affected Platforms

Runtime - iOS

Areas

Fabric - The New Renderer

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

System:
  OS: macOS 15.4.1
  CPU: (16) arm64 Apple M4 Max
  Memory: 148.73 MB / 64.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 22.13.1
    path: /usr/local/bin/node
  Yarn:
    version: 1.22.22
    path: ~/.npm-global/bin/yarn
  npm:
    version: 10.9.2
    path: /usr/local/bin/npm
  Watchman:
    version: 2024.12.02.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods:
    version: 1.16.2
    path: /Users/chrfalch/.rbenv/shims/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 24.4
      - iOS 18.4
      - macOS 15.4
      - tvOS 18.4
      - visionOS 2.4
      - watchOS 11.4
  Android SDK:
    API Levels:
      - "26"
      - "31"
      - "34"
      - "35"
    Build Tools:
      - 26.0.3
      - 34.0.0
      - 35.0.0
    System Images:
      - android-26 | Google APIs Intel x86_64 Atom
      - android-31 | Google APIs ARM 64 v8a
      - android-34 | Google APIs ARM 64 v8a
      - android-34 | Google Play ARM 64 v8a
      - android-35-ext14 | Google Play ARM 64 v8a
      - android-35 | Google Play ARM 64 v8a
      - android-TiramisuPrivacySandbox | Google APIs ARM 64 v8a
    Android NDK: Not Found
IDEs:
  Android Studio: 2024.3 AI-243.24978.46.2431.13363775
  Xcode:
    version: 16.3/16E140
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.14
    path: /usr/bin/javac
  Ruby:
    version: 3.3.6
    path: /Users/chrfalch/.rbenv/shims/ruby
npmPackages:
  "@react-native-community/cli": Not Found
  react: Not Found
  react-native: Not Found
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: true
iOS:
  hermesEnabled: true
  newArchEnabled: true

Stacktrace or Logs

No crash is happening.

MANDATORY Reproducer

https://github.com/chrfalch/interoplayer-repro

Screenshots and Videos

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Platform: iOSiOS applications.Resolution: PR SubmittedA pull request with a fix has been provided.Type: New ArchitectureIssues and PRs related to new architecture (Fabric/Turbo Modules)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions