Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[iOS] Attempt to present <RCTFabricModalHostViewController: 0x11c98e200> on <RCTFabricModalHostViewController: 0x11a3c7a00> (from <RCTFabricModalHostViewController: 0x11a3c7a00>) whose view is not in the window hierarchy. #48195

Closed
georgi2005atanasov opened this issue Dec 10, 2024 · 6 comments
Labels
Component: Modal Needs: Attention Issues where the author has responded to feedback. Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue. Newer Patch Available Platform: iOS iOS applications. Type: New Architecture Issues and PRs related to new architecture (Fabric/Turbo Modules)

Comments

@georgi2005atanasov
Copy link

georgi2005atanasov commented Dec 10, 2024

Description

Hello, i am getting this error when opening one modal after the other.

Steps to reproduce

I am trying to render conditionally the modals like this:

<FIrstModal visible={stage === Stages.FirstStage} closeHandler={close} /> <SecondModal visible={stage === Stages.SecondStage} closeHandler={close} /> <ThirdModal visible={stage === Stages.ThirdStage} closeHandler={close} />

of course, each modal has a 'visible' property which is determined by the current stage (which is an enum) as shown in this example. After closing the first modal (closing basically represents changing the current stage so it gets increased by 1 and goes to the second modal and so on) I get the error which I pasted in the title. I would be glad if someone had already faced this kind of issue!

React Native Version

0.76.3

Affected Platforms

Build - MacOS

Areas

Fabric - The New Renderer

Output of npx react-native info

System:
  OS: macOS 15.1.1
  CPU: (8) arm64 Apple M3
  Memory: 960.16 MB / 16.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 23.3.0
    path: /opt/homebrew/bin/node
  Yarn:
    version: 3.6.4
    path: /opt/homebrew/bin/yarn
  npm:
    version: 10.9.0
    path: /opt/homebrew/bin/npm
  Watchman:
    version: 2024.11.25.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods:
    version: 1.16.2
    path: /Users/myname/.rbenv/shims/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 24.1
      - iOS 18.1
      - macOS 15.1
      - tvOS 18.1
      - visionOS 2.1
      - watchOS 11.1
  Android SDK: Not Found
IDEs:
  Android Studio: 2024.1 AI-241.18034.62.2412.12266719
  Xcode:
    version: 16.1/16B40
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 20.0.2
    path: /usr/bin/javac
  Ruby:
    version: 2.7.6
    path: /Users/myname/.rbenv/shims/ruby
npmPackages:
  "@react-native-community/cli":
    installed: 15.0.1
    wanted: 15.0.1
  react:
    installed: 18.3.1
    wanted: ^18.3.1
  react-native:
    installed: 0.76.3
    wanted: 0.76.3
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: true
iOS:
  hermesEnabled: true
  newArchEnabled: true

Stacktrace or Logs

Attempt to present <RCTFabricModalHostViewController: 0x11c98e200> on <RCTFabricModalHostViewController: 0x11a3c7a00> (from <RCTFabricModalHostViewController: 0x11a3c7a00>)  whose view is not in the window hierarchy.

Reproducer

https://github.com/georgi2005atanasov

Screenshots and Videos

No response

@georgi2005atanasov georgi2005atanasov added Needs: Triage 🔍 Type: New Architecture Issues and PRs related to new architecture (Fabric/Turbo Modules) labels Dec 10, 2024
@react-native-bot
Copy link
Collaborator

Tip

Newer version available: You are on a supported minor version, but it looks like there's a newer patch available - 0.76.5. Please upgrade to the highest patch for your minor or latest and verify if the issue persists (alternatively, create a new project and repro the issue in it). If it does not repro, please let us know so we can close out this issue. This helps us ensure we are looking at issues that still exist in the most recent releases.

@react-native-bot react-native-bot added Component: Modal Platform: iOS iOS applications. Needs: Author Feedback Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue. labels Dec 10, 2024
@react-native-bot
Copy link
Collaborator

Tip

Newer version available: You are on a supported minor version, but it looks like there's a newer patch available - undefined. Please upgrade to the highest patch for your minor or latest and verify if the issue persists (alternatively, create a new project and repro the issue in it). If it does not repro, please let us know so we can close out this issue. This helps us ensure we are looking at issues that still exist in the most recent releases.

@react-native-bot
Copy link
Collaborator

Warning

Missing reproducer: We could not detect a reproducible example in your issue report. Please provide either:

@shubhamguptadream11
Copy link
Collaborator

@georgi2005atanasov Can you please provide a valid reproducer. You can use this template

@WilliamWelsh
Copy link

Possibly related to #47694 ?

@georgi2005atanasov
Copy link
Author

Guys, the problem was related tothe version itself - after I upgraded to 0.76.5 every problem disappeared. React native bot did its job :).

@github-actions github-actions bot added Needs: Attention Issues where the author has responded to feedback. and removed Needs: Author Feedback labels Dec 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Modal Needs: Attention Issues where the author has responded to feedback. Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue. Newer Patch Available Platform: iOS iOS applications. Type: New Architecture Issues and PRs related to new architecture (Fabric/Turbo Modules)
Projects
None yet
Development

No branches or pull requests

4 participants