ionic-team / ionic-team/ionic-docs

React Routes Switch in Ionic can not route to an IonPage

Đang mở
#2,570 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
triage
Ngôn ngữ chính
MDX
Star
621
Fork
3.2k
Merge trung bình
1 ngày 2 giờ
Pull request đã merge (30 ngày)
86

Mô tả

### URL

https://ionicframework.com/docs/react/navigation#switches-in-ionrouteroutlet

### Issue Description

The `Switch` component can not route to a sub component that is wrapped in `IonPage`.

This is what I think is the reason.
Because `IonPage` is exclusive, there can only be a single `IonPage` in a view. The `Switch` can not route to a component with `IonPage`. As shown by the React Router documentation "basic" example, a custom page component can implement a list of links that uses a `Switch` to route a subview of components below it within the same view. This would result in nested `IonPage` components, and therefore doesn't work.

The `Switch` component is useful only in the case where you want to insert components into a subview that will update the URL and work with the history stack, but in a way that is not tabs.

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

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

Đánh giá

Issue này chưa được đánh giá.

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.