Skip to content

bug: IonTabs throws when a Fragment contains one IonRouterOutlet #31410

Description

@Benziza

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

  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

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions