`showOverlay` creates a scene-less `UIWindow`, so overlays never appear under UIScene lifecycle

未关闭
#8,345 2 条评论 2 个 reaction 已指派 0 人 在 GitHub 查看

@yedidyak 已经在做这个了。

开始于 2026年11月2日。

  • #8374 来自 @yedidyak —— 未关闭

评估

难度
3/5
预计耗时
1-2 天
新手友好度
68/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
技术栈
ios, react-native
领域
mobile

调研方向

从 Navigation.showOverlay 和 RNNOverlayWindow 的原生实现入手,尤其是 initWithFrame: 路径,并将其与 setRoot 使用的现有 _mainWindow 处理进行比较。使用 UIWindowSceneDelegate 进行复现,并验证 overlay 窗口是否与宿主 UIWindowScene 关联。完成的标准是 showOverlay 显示在当前 root 之上,同时现有的 setRoot 行为保持不变。

由索引模型根据 Issue 内容生成。

描述

platform: iOS type: accepted/bug
What happened?

On iOS, Navigation.showOverlay() creates a new RNNOverlayWindow with initWithFrame: and never assigns a UIWindowScene.

With a scene-based app lifecycle, that window is not added to the scene, so the overlay never appears. JS still mounts and runs (the overlay VC is created and rendered), which makes this look like a hang: native/RNN splash dismisses, overlay logic is running, but the screen stays on RNNSplashScreenViewController / the current root.

Navigation.setRoot() is not affected, because it attaches the layout to the existing _mainWindow that the host already bound to the scene.

This is easy to miss on older iOS if the app still used the AppDelegate window path. It becomes a hard break once the app adopts UIWindowScene (mandatory on iOS 26+).

What was the expected behaviour?

showOverlay shows the overlay above the current root on the same UIWindowScene.

Was it tested on latest react-native-navigation?
  • I have tested this issue on the latest react-native-navigation release and it still reproduces.
Help us reproduce this issue!
  1. Use UIScene lifecycle (UIApplicationSceneManifest + UIWindowSceneDelegate).
  2. Create the window with initWithWindowScene: and pass it to RNN (delegate.window set before bootstrap).
  3. On Navigation.events().registerAppLaunchedListener, do not setRoot. Call:
Navigation.showOverlay({
  component: {
    name: 'example.OverlayScreen',
  },
});
  1. OverlayScreen mounts (componentDidMount / useEffect runs) but nothing is visible. The scene window is still RNNSplashScreenViewController.

Control: the same screen shown via setRoot appears correctly:

Navigation.setRoot({
  root: {
    stack: {
      children: [{ component: { name: 'example.OverlayScreen' } }],
    },
  },
});
In what environment did this happen?
  • react-native-navigation: 8.8.9
  • react-native: 0.87 (New Architecture / Fabric, bridgeless)
  • iOS: 26 / 27 (also repros conceptually on iOS 13+ with UIScene)
  • Host: RNNAppDelegate + custom UIWindowSceneDelegate
  • Platform: iOS only
主要语言
MDX
星标
13.2k
派生
2.6k
平均合并
2 天 10 小时
30 天内合并 PR
6

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

wix/react-native-navigation 的其他 Issue

查看 wix/react-native-navigation 的全部 Issue

相似的 Issue

更多 Mobile Dev Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。