Hi,
I’ve been trying to get routing working for … too long.
I have it down to the following.
<IonApp>
<IonReactRouter>
<IonSplitPane contentId="main">
<IonRouterOutlet id="main">
<Route path="/page/Home" component={HomePage}/>
<Route path="/page/Login" component={LoginPage}/>
<Redirect exact from='/page/Counter' to='/page/Login'/>
</IonRouterOutlet>
<IonContent>
<IonList id="menu-list">
<div><Link to={'/page/Home'}>Home</Link></div>
<div><Link to={'/page/Login'}>Login</Link></div>
<div><Link to={'/page/Counter'}>Counter</Link></div>
</IonList>
</IonContent>
</IonSplitPane>
</IonReactRouter>
</IonApp>
If I click on Home or Login, all is good.
If I click on Counter, then the URL updates to http://localhost:3000/page/Counter, however a blank screen is rendered. If I then click in URL address bar and manually hit enter, the URL updates automatically to http://localhost:3000/page/Login and the Login page is shown.
I would expect the navigation to happen when I click on the Counter link.
Also, the same behaviour is happening with <IonItem routerLink ='/page/Counter'/>
as well.
Can anyone see what I’m doing wrong?
Thank you!
1 post - 1 participant