I am using ep-mobx-router v0.2.3 in a react typescript project, which is very similar to mobx-router. The documentation page shows that beforeExit is a hook present in the package, but when I am trying to use it, it gives error that its not present in ep-mobx-router. I checked in my "index.d.ts" file in node modules of ep-mobx-router, only onEnter is present there. If I change in the node modules files, and add an entry for beforeEnter there, it works fine.
interface IRoute {
path: string;
component?: React.ComponentType<any> | React.ComponentType<any> | React.ReactElement<any> | null;
async?: Promise<any>;
onEnter?: LifecyclePropsType;beforeExit?: LifecyclePropsType
onParamsChange?: LifecyclePropsType;
childRoutes?: { [key: string]: any };
}
this interface is present in index.d.ts file in node modules of "ep-mobx-router".
And I want beforeExit also there, like -
interface IRoute {
path: string;
component?: React.ComponentType<any> | React.ComponentType<any> | React.ReactElement<any> | null;
async?: Promise<any>;
onEnter?: LifecyclePropsType;
**beforeExit?: LifecyclePropsType**;
onParamsChange?: LifecyclePropsType;
childRoutes?: { [key: string]: any };
}
How can I add this extra property to the interface through my react js code?