I am working on a react app where I want to stop my component from unmounting based on some conditions.
As far as I have researched I found one option of setRouteLeaveHook using react router (as mentioned here). But the problem is I have same route i.e url is same for both components. Also I don't have this.props.router option or this.context.router option where I can pass this.
Is there something I can do ?