supasate / connected-react-router

A Redux binding for React Router v4
MIT License
4.73k stars 592 forks source link

Expose an Error Handler #608

Open IPWright83 opened 1 year ago

IPWright83 commented 1 year ago

It would be really great if you could expose some event handlers. Specifically I'm interested in an Error Handler (but I can see how LocationChangedHandler might also be useful).

The reason I want to be able to handle errors, is unfortunately sometimes navigating to the URL may trigger an issue and need some sort of corrective behaviour. While this could be wrapped in an ErrorBoundary/component it doesn't feel ideal. Here's an example on how others have dealt with the issue we're hitting with vue-router https://stackoverflow.com/a/74861436/21061