bug: IonTabs throws when a Fragment contains one IonRouterOutlet
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 72/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- react, typescript
- 领域
- frontend
调研方向
从 IonTabs 的实现开始,使用 npm install 和 npm run dev 通过链接的应用复现该故障。将 IonRouterOutlet 作为传递给 IonTabs 的 React Fragment 中唯一的子元素进行渲染,并确认不会出现 TypeError,以验证修复有效。
由索引模型根据 Issue 内容生成。
描述
Prerequisites
- I have read the contributing guidelines.
- I agree to follow the Code of Conduct.
- I searched existing issues without finding this problem.
Ionic Framework Version
v8.x, v9.x, Nightly
Current Behavior
When IonRouterOutlet is the only child of a React Fragment passed to IonTabs, rendering throws:
TypeError: Cannot read properties of undefined (reading 'type')
IonTabs treats the Fragment's children as an array, but React stores a single child as an element.
Expected Behavior
IonTabs should render when IonRouterOutlet is wrapped in a single-child Fragment.
Steps to Reproduce
- Clone the reproduction.
- Run
npm installandnpm run dev. - Open the app.
Code Reproduction URL
https://github.com/Benziza/ion-tabs-fragment-repro
Ionic Info
Ionic CLI : 7.2.1
Ionic Framework : @ionic/react 9.0.1
NodeJS : v25.6.0
npm : 11.12.1
OS : Windows 10
Additional Information
Removing the Fragment allows the same app to render.
- 主要语言
- TypeScript
- 星标
- 52.7k
- 派生
- 13.3k
- 平均合并
- 2 天 20 小时
- 30 天内合并 PR
- 35
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
ionic-team/ionic-framework 的其他 Issue
-
triage
难度 2/5 1-3 小时 新手友好度 72/100
ionic-team/ionic-framework#31314 ·
-
triage
难度 2/5 1-3 小时 新手友好度 86/100
ionic-team/ionic-framework#31291 ·
-
triage
难度 2/5 1-3 小时 新手友好度 70/100
ionic-team/ionic-framework#30738 ·
-
package: core type: bug
难度 1/5 1 小时以内 新手友好度 72/100
ionic-team/ionic-framework#29864 · 1 条评论 ·
-
package: core type: feature request
难度 2/5 1-3 小时 新手友好度 75/100
ionic-team/ionic-framework#29607 · 4 条评论 · 1 个 reaction ·
查看 ionic-team/ionic-framework 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 84/100
Eynzof/Hermes-CN-Desktop#610 ·
-
bug clawsweeper:linked-pr-open clawsweeper:needs-live-repro clawsweeper:no-new-fix-pr impact:message-loss issue-rating: 🐚 platinum hermit P2 regression
难度 2/5 1-3 小时 新手友好度 78/100
-
enhancement
难度 2/5 1-3 小时 新手友好度 68/100
-
calcite-components needs triage refactor
难度 2/5 1-3 小时 新手友好度 75/100
Esri/calcite-design-system#15203 ·
-
难度 2/5 1-3 小时 新手友好度 90/100
danielmiessler/LifeOS#2218 ·