Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70759

[Ionic4 React] How to IonRouterOutlet right way

$
0
0

@phivo wrote:

Inside each component must contains IonPage to wrap all child component inside.
Example:

const HomePage: React.FC = () => {
return (
<IonPage>
<IonHeader />
<IconContent>
This is home page
</IconContent>
</IonPage>
)
}

const AboutPage: React.FC = () =>{
return (
<IonPage>
<IonHeader />
<IconContent>
This is about page
</IconContent>
</IonPage>
)
}

const App: React.FC = () => {
<IonApp>
      <IonReactRouter>
        <IonRouterOutlet>
          <Route path="/about" component={AboutPage} exact/>
          <Route path="/home" component={HomePage} exact/>
        </IonRouterOutlet>
      </IonReactRouter>
    </IonApp>
}

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 70759

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>