5

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 ?

Vikas Yadav
  • 3,094
  • 2
  • 20
  • 21
Shivani
  • 350
  • 3
  • 13

0 Answers0