Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all articles
Browse latest Browse all 48980

routerLink not firing redirects

$
0
0

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! :slight_smile:

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 48980

Trending Articles



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