bug: IonTabs throws when a Fragment contains one IonRouterOutlet

Đang mở Phù hợp với người mới
#31,410 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
72/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
react, typescript
Lĩnh vực
frontend

Hướng nghiên cứu

Bắt đầu với phần triển khai IonTabs và tái hiện lỗi bằng ứng dụng được liên kết với npm install và npm run dev. Xác nhận bản sửa bằng cách render một IonRouterOutlet làm phần tử con duy nhất trong một React Fragment được truyền vào IonTabs mà không xảy ra TypeError.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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

Ngôn ngữ chính
TypeScript
Star
52.7k
Fork
13.3k
Merge trung bình
2 ngày 20 giờ
Pull request đã merge (30 ngày)
35

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của ionic-team/ionic-framework

Tất cả issue của ionic-team/ionic-framework

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.