ionic-team / ionic-team/ionic-framework

bug: IonTabs throws when a Fragment contains one IonRouterOutlet

Offen Anfängerfreundlich
#31,410 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
triage
Vorherrschende Sprache
TypeScript
Sterne
52.7k
Forks
13.3k
Ø Merge
1 T. 15 Std.
Gemergte PRs (30 T.)
51

Beschreibung

### 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.

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

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.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
react, typescript
Bereich
frontend
Issue-Typ
Bug
Schwierigkeit
2/5
Geschätzter Aufwand
1-3 Stunden
Aktivitätsstatus
Aktiv
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
72/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.