Skip to content

Commit 6c33611

Browse files
authored
docs(tabs): add IonPage wrapper to React router examples (#4356)
1 parent 91fecdb commit 6c33611

File tree

18 files changed

+48
-36
lines changed

18 files changed

+48
-36
lines changed

docs/react/navigation.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,8 @@ const DashboardPage: React.FC<RouteComponentProps> = ({ match }) => {
146146

147147
The `IonPage` component wraps each view in an Ionic React app and allows page transitions and stack navigation to work properly. Each view that is navigated to using the router must include an `IonPage` component.
148148

149+
`IonPage` is also required for proper styling. It provides a flex container that ensures page content, such as `IonContent`, is properly sized and does not overlap other UI elements like `IonTabBar`.
150+
149151
```tsx
150152
import { IonContent, IonHeader, IonPage, IonTitle, IonToolbar } from '@ionic/react';
151153
import React from 'react';

docs/vue/navigation.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -494,6 +494,8 @@ Nothing should be provided inside of `IonRouterOutlet` when setting it up in you
494494

495495
The `IonPage` component wraps each view in an Ionic Vue app and allows page transitions and stack navigation to work properly. Each view that is navigated to using the router must include an `IonPage` component.
496496

497+
`IonPage` is also required for proper styling. It provides a flex container that ensures page content, such as `IonContent`, is properly sized and does not overlap other UI elements like `IonTabBar`.
498+
497499
```vue
498500
<template>
499501
<ion-page>

static/usage/v6/tabs/router/react/home_page_tsx.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
```tsx
22
import React from 'react';
3-
import { IonContent, IonHeader, IonTitle, IonToolbar } from '@ionic/react';
3+
import { IonContent, IonHeader, IonPage, IonTitle, IonToolbar } from '@ionic/react';
44

55
const HomePage = () => (
6-
<>
6+
<IonPage>
77
<IonHeader>
88
<IonToolbar>
99
<IonTitle>Listen now</IonTitle>
@@ -21,7 +21,7 @@ const HomePage = () => (
2121
Listen now content
2222
</div>
2323
</IonContent>
24-
</>
24+
</IonPage>
2525
);
2626

2727
export default HomePage;

static/usage/v6/tabs/router/react/library_page_tsx.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
```tsx
22
import React from 'react';
3-
import { IonContent, IonHeader, IonTitle, IonToolbar } from '@ionic/react';
3+
import { IonContent, IonHeader, IonPage, IonTitle, IonToolbar } from '@ionic/react';
44

55
const LibraryPage = () => (
6-
<>
6+
<IonPage>
77
<IonHeader>
88
<IonToolbar>
99
<IonTitle>Library</IonTitle>
@@ -21,7 +21,7 @@ const LibraryPage = () => (
2121
Library content
2222
</div>
2323
</IonContent>
24-
</>
24+
</IonPage>
2525
);
2626

2727
export default LibraryPage;

static/usage/v6/tabs/router/react/radio_page_tsx.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
```tsx
22
import React from 'react';
3-
import { IonContent, IonHeader, IonTitle, IonToolbar } from '@ionic/react';
3+
import { IonContent, IonHeader, IonPage, IonTitle, IonToolbar } from '@ionic/react';
44

55
const RadioPage = () => (
6-
<>
6+
<IonPage>
77
<IonHeader>
88
<IonToolbar>
99
<IonTitle>Radio</IonTitle>
@@ -21,7 +21,7 @@ const RadioPage = () => (
2121
Radio content
2222
</div>
2323
</IonContent>
24-
</>
24+
</IonPage>
2525
);
2626

2727
export default RadioPage;

static/usage/v6/tabs/router/react/search_page_tsx.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
```tsx
22
import React from 'react';
3-
import { IonContent, IonHeader, IonTitle, IonToolbar } from '@ionic/react';
3+
import { IonContent, IonHeader, IonPage, IonTitle, IonToolbar } from '@ionic/react';
44

55
const SearchPage = () => (
6-
<>
6+
<IonPage>
77
<IonHeader>
88
<IonToolbar>
99
<IonTitle>Search</IonTitle>
@@ -21,7 +21,7 @@ const SearchPage = () => (
2121
Search content
2222
</div>
2323
</IonContent>
24-
</>
24+
</IonPage>
2525
);
2626

2727
export default SearchPage;

static/usage/v7/tabs/router/react/home_page_tsx.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
```tsx
22
import React from 'react';
3-
import { IonContent, IonHeader, IonTitle, IonToolbar } from '@ionic/react';
3+
import { IonContent, IonHeader, IonPage, IonTitle, IonToolbar } from '@ionic/react';
44

55
const HomePage = () => (
6-
<>
6+
<IonPage>
77
<IonHeader>
88
<IonToolbar>
99
<IonTitle>Listen now</IonTitle>
@@ -21,7 +21,7 @@ const HomePage = () => (
2121
Listen now content
2222
</div>
2323
</IonContent>
24-
</>
24+
</IonPage>
2525
);
2626

2727
export default HomePage;

static/usage/v7/tabs/router/react/library_page_tsx.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
```tsx
22
import React from 'react';
3-
import { IonContent, IonHeader, IonTitle, IonToolbar } from '@ionic/react';
3+
import { IonContent, IonHeader, IonPage, IonTitle, IonToolbar } from '@ionic/react';
44

55
const LibraryPage = () => (
6-
<>
6+
<IonPage>
77
<IonHeader>
88
<IonToolbar>
99
<IonTitle>Library</IonTitle>
@@ -21,7 +21,7 @@ const LibraryPage = () => (
2121
Library content
2222
</div>
2323
</IonContent>
24-
</>
24+
</IonPage>
2525
);
2626

2727
export default LibraryPage;

static/usage/v7/tabs/router/react/radio_page_tsx.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
```tsx
22
import React from 'react';
3-
import { IonContent, IonHeader, IonTitle, IonToolbar } from '@ionic/react';
3+
import { IonContent, IonHeader, IonPage, IonTitle, IonToolbar } from '@ionic/react';
44

55
const RadioPage = () => (
6-
<>
6+
<IonPage>
77
<IonHeader>
88
<IonToolbar>
99
<IonTitle>Radio</IonTitle>
@@ -21,7 +21,7 @@ const RadioPage = () => (
2121
Radio content
2222
</div>
2323
</IonContent>
24-
</>
24+
</IonPage>
2525
);
2626

2727
export default RadioPage;

static/usage/v7/tabs/router/react/search_page_tsx.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
```tsx
22
import React from 'react';
3-
import { IonContent, IonHeader, IonTitle, IonToolbar } from '@ionic/react';
3+
import { IonContent, IonHeader, IonPage, IonTitle, IonToolbar } from '@ionic/react';
44

55
const SearchPage = () => (
6-
<>
6+
<IonPage>
77
<IonHeader>
88
<IonToolbar>
99
<IonTitle>Search</IonTitle>
@@ -21,7 +21,7 @@ const SearchPage = () => (
2121
Search content
2222
</div>
2323
</IonContent>
24-
</>
24+
</IonPage>
2525
);
2626

2727
export default SearchPage;

0 commit comments

Comments
 (0)