0

Is there a global hook or single router hook in react-router4? or some good custom impementation? this feature is really quite useful.

I also use Vue, it's offical implementation is like below: javascript router.beforeEach((to, from, next) => {...}) I can do some block things, like api request etc.

olyy111
  • 1
  • 1
  • So, to clarify, do you mean the same thing shown here?: https://stackoverflow.com/questions/41911309/how-to-listen-to-route-changes-in-react-router-v4 – vahdet Jun 01 '18 at 09:15
  • no, jusk like. I just want to do something when I match the route before the component start it's life cycle, even some async operations. – olyy111 Jun 01 '18 at 12:44

0 Answers0