mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-18 19:21:34 +08:00
fix(react): nested router outlets will not reanimate entered views (#24672)
Resolves #24107
This commit is contained in:
@ -35,7 +35,7 @@ export const IonRouterContext = React.createContext<IonRouterContextState>({
|
||||
});
|
||||
|
||||
/**
|
||||
* A hook for more direct control over routing in an Ionic React applicaiton. Allows you to pass additional meta-data to the router before the call to the native router.
|
||||
* A hook for more direct control over routing in an Ionic React application. Allows you to pass additional meta-data to the router before the call to the native router.
|
||||
*/
|
||||
export function useIonRouter(): UseIonRouterResult {
|
||||
const context = useContext(IonRouterContext);
|
||||
|
@ -1,3 +1,4 @@
|
||||
import { componentOnReady } from '@ionic/core';
|
||||
import React from 'react';
|
||||
|
||||
import { IonRouterOutletInner } from '../components/inner-proxies';
|
||||
@ -24,9 +25,9 @@ export class OutletPageManager extends React.Component<OutletPageManagerProps> {
|
||||
|
||||
componentDidMount() {
|
||||
if (this.ionRouterOutlet) {
|
||||
setTimeout(() => {
|
||||
componentOnReady(this.ionRouterOutlet, () => {
|
||||
this.context.registerIonPage(this.ionRouterOutlet!, this.props.routeInfo!);
|
||||
}, 25);
|
||||
});
|
||||
|
||||
this.ionRouterOutlet.addEventListener(
|
||||
'ionViewWillEnter',
|
||||
|
Reference in New Issue
Block a user