ionic-team / ionic-team/ionic-framework

bug: IonTabs throws when a Fragment contains one IonRouterOutlet

オープン 初心者向け
#31,410 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る
triage
主要言語
TypeScript
スター
52.7k
フォーク
13.3k
平均マージ
1日 15時間
マージ済み PR(30日)
51

説明

### Prerequisites

- [x] I have read the contributing guidelines.
- [x] I agree to follow the Code of Conduct.
- [x] 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:

```text
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

1. Clone the reproduction.
2. Run `npm install` and `npm run dev`.
3. Open the app.

### Code Reproduction URL

https://github.com/Benziza/ion-tabs-fragment-repro

### Ionic Info

```text
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.

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

Start with the IonTabs implementation and reproduce the failure using the linked app with npm install and npm run dev. Confirm the fix by rendering an IonRouterOutlet as the only child in a React Fragment passed to IonTabs without the TypeError.

索引モデルが issue の本文から書いたものです。

評価

技術スタック
react, typescript
領域
frontend
issue の種類
バグ
難易度
2/5
見積もり時間
1〜3時間
活発さ
活発
明瞭さ
おおむね明確
初心者へのやさしさ
72/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。