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

routerLink on button not working

$
0
0

I have a button and an IonRouterLink on a page, both with the same routerLink attributes. The router link navigates forward, but the button does not.

The button:

<IonCard>
    <IonCardContent>
        <IonItem>
            ...
            <IonButton expand="block"  routerLink={`/scan/54321`} routerDirection={"forward"}>Open WO</IonButton>
	    </IonItem>
    </IonCardContent>
</IonCard>

The working router link:

<IonRouterLink routerLink={`/scan/54321`} routerDirection={"forward"}>54321</IonRouterLink>

How can I get the button to render the route?

I’m using:

  • “react”: “^17.0.1”
  • “react-dom”: “^17.0.1”
  • “react-router”: “^5.2.0”
  • “react-router-dom”: “^5.2.0”
  • “react-scripts”: “4.0.2”

4 posts - 2 participants

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>