@@ -3,7 +3,7 @@ import React from 'react';
33import { IonTabs , IonTabBar , IonTabButton , IonIcon , IonLabel , IonRouterOutlet } from ' @ionic/react' ;
44import { IonReactRouter } from ' @ionic/react-router' ;
55
6- import { Route , Redirect } from ' react-router' ;
6+ import { Route , Navigate } from ' react-router-dom ' ;
77
88import { 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