Prerequisites
Ionic Framework Version
Current Behavior
When using Ionic React + React 18 + the new createRoot API, duplicate page transitions occur. This is due to IonPage being unmounted and remounted by react. The registerIonPage function calls for a transition every time a page is registered:
|
this.handlePageTransition(routeInfo); |
However, it was written with the intent that page elements would be registered at most once.
Expected Behavior
I expect there to be only 1 page transition.
Steps to Reproduce
- Clone repo.
- Run
npm install.
- Run
npm run start.
- Click one of the list items in the app. Observe that the page transition occurs twice.
Code Reproduction URL
https://github.com/liamdebeasi/react-18-transition
Ionic Info
Ionic:
Ionic CLI : 6.20.1 (/Users/liamdebeasi/Ionic/ionic-cli/packages/@ionic/cli)
Ionic Framework : @ionic/react 6.2.3
Capacitor:
Capacitor CLI : 4.1.0
@capacitor/android : not installed
@capacitor/core : 4.1.0
@capacitor/ios : not installed
Utility:
cordova-res : not installed globally
native-run : 1.6.0
System:
NodeJS : v16.11.1 (/Users/liamdebeasi/.nvm/versions/node/v16.11.1/bin/node)
npm : 8.0.0
OS : macOS Monterey
Additional Information
No response
Prerequisites
Ionic Framework Version
Current Behavior
When using Ionic React + React 18 + the new createRoot API, duplicate page transitions occur. This is due to
IonPagebeing unmounted and remounted by react. TheregisterIonPagefunction calls for a transition every time a page is registered:ionic-framework/packages/react-router/src/ReactRouter/StackManager.tsx
Line 212 in bd715a5
However, it was written with the intent that page elements would be registered at most once.
Expected Behavior
I expect there to be only 1 page transition.
Steps to Reproduce
npm install.npm run start.Code Reproduction URL
https://github.com/liamdebeasi/react-18-transition
Ionic Info
Additional Information
No response