Skip to content

Commit d0f6f2f

Browse files
committed
docs(react-router): converting playground example to rr6
1 parent 1bd69b1 commit d0f6f2f

1 file changed

Lines changed: 6 additions & 11 deletions

File tree

static/usage/v9/tabs/router/react/main_tsx.md

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import React from 'react';
33
import { IonTabs, IonTabBar, IonTabButton, IonIcon, IonLabel, IonRouterOutlet } from '@ionic/react';
44
import { IonReactRouter } from '@ionic/react-router';
55

6-
import { Route, Redirect } from 'react-router';
6+
import { Route, Navigate } from 'react-router-dom';
77

88
import { playCircle, radio, library, search } from 'ionicons/icons';
99

@@ -17,16 +17,11 @@ function Example() {
1717
<IonReactRouter>
1818
<IonTabs>
1919
<IonRouterOutlet>
20-
<Redirect exact path="/" to="/home" />
21-
{/*
22-
Use the render method to reduce the number of renders your component will have due to a route change.
23-
24-
Use the component prop when your component depends on the RouterComponentProps passed in automatically.
25-
*/}
26-
<Route path="/home" render={() => <HomePage />} exact={true} />
27-
<Route path="/radio" render={() => <RadioPage />} exact={true} />
28-
<Route path="/library" render={() => <LibraryPage />} exact={true} />
29-
<Route path="/search" render={() => <SearchPage />} exact={true} />
20+
<Route path="/" element={<Navigate to="/home" replace />} />
21+
<Route path="/home" element={<HomePage />} />
22+
<Route path="/radio" element={<RadioPage />} />
23+
<Route path="/library" element={<LibraryPage />} />
24+
<Route path="/search" element={<SearchPage />} />
3025
</IonRouterOutlet>
3126

3227
<IonTabBar slot="bottom">

0 commit comments

Comments
 (0)