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