title: React - change route from function
body: <p>My fetch function is sometimes returning errors. If that happens I would like to go to something like url/notfound and render NotFound component. Can it be done with react router? Are there any other ways to change route from function ? </p>