question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

bug: Ionic React page transitions not working with history.push

See original GitHub issue

Prerequisites

Ionic Framework Version

  • v4.x
  • v5.x
  • v6.x
  • Nightly

Current Behavior

When transitioning between pages, it appears that the pages transition by sliding upward rather than coming in from the right.

Expected Behavior

Two <Route> components in an <IonRouterOutlet> should transition from left to right using useHistory().push()

Steps to Reproduce

Please see the codesandbox URL.

  <IonApp>
    <IonReactRouter >
      <IonRouterOutlet animated >
        <Route exact path="/page1" >
          <Page1 />
        </Route>
        <Route exact path="/page2">
          <Page2 />
        </Route>
        <Route exact path="/">
          <Redirect to="/page1" />
        </Route>
      </IonRouterOutlet>
    </IonReactRouter>
  </IonApp>

Code Reproduction URL

https://codesandbox.io/s/ionic6-react-typescript-page-transitions-veifn6?file=/src/App.tsx

Ionic Info

Ionic:

   Ionic CLI       : 6.20.1 (/usr/local/lib/node_modules/@ionic/cli)
   Ionic Framework : @ionic/react 6.1.15

Capacitor:

   Capacitor CLI      : 3.6.0
   @capacitor/android : not installed
   @capacitor/core    : 3.6.0
   @capacitor/ios     : not installed

Utility:

   cordova-res : not installed globally
   native-run  : 1.6.0

System:

   NodeJS : v16.13.0 (/usr/local/bin/node)
   npm    : 8.14.0
   OS     : macOS Monterey

Additional Information

No response

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
benallfreecommented, Jul 21, 2022

Thank you for the help!

0reactions
ionitron-bot[bot]commented, Aug 20, 2022

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

Read more comments on GitHub >

github_iconTop Results From Across the Web

bug: Ionic 4 / React history.push() is not changing pages · ...
Current behavior: history.push does not change pages. I believe <IonRouterOutlet> is not working, because the kitchen sink React Ionic demo ...
Read more >
ionic react push to component transition issue
I am developing an app with ionic/react and need to push to new component hence doing it by this.props.history.push({ pathname: ...
Read more >
Ionic-react - so many render issues related to routing
This is a very general question, but I'm wondering if there's someone actively working on the Ionic-React library?
Read more >
Routing, programmatically in Ionic React
push () This method allows us to push a route into the history of the router. ... all routes and pages/tabs and main...
Read more >
IonRouterOulet does not apply page transition in ios. Ionic ...
Coding example for the question IonRouterOulet does not apply page transition in ios. Ionic React-Reactjs.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found