Redirect Route abortReason caught before use
See original GitHub issueIn the code
/**
* The default aborted transition handler for new routers.
*/
function defaultAbortHandler(abortReason, location) {
if (typeof location === 'string')
throw new Error('Unhandled aborted transition! Reason: ' + abortReason);
if (abortReason instanceof Cancellation) {
return;
} else if (abortReason instanceof Redirect) {
location.replace(this.makePath(abortReason.to, abortReason.params, abortReason.query));
} else {
location.pop();
}
}
The location is always a string, hence the rest of the code fails. I’ve got an example of the problem at https://github.com/CaseyLeask/react-router-mega-demo/commit/ffb06da63677546e3296e675aa22bb32cad21629
Issue Analytics
- State:
- Created 9 years ago
- Comments:11 (6 by maintainers)
Top Results From Across the Web
Redirect Route abortReason caught before use #612 - GitHub
The default aborted transition handler for new routers. */ function defaultAbortHandler(abortReason, location) { if (typeof location ...
Read more >Redirect Vue Router to intended page after a user signs in
I have a catch all route guard that checks if the user is signed in when trying to access a page and redirects...
Read more >JavaScript create Examples, react-router.create JavaScript ...
JavaScript create - 30 examples found. These are the top rated real world JavaScript examples of react-router.create extracted from open source projects.
Read more >HTTP Redirects - The PHP Framework For Web Artisans
There are several ways to generate a RedirectResponse instance. The simplest method is to use the global redirect helper: Route::get('/dashboard', function ...
Read more >Stop using client-side route redirects - Kent C. Dodds
First, the goal of using a client-side redirect (like with Redirect's from prop or similar) is to ensure the user doesn't land on...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I’ve only just started with ReactRouter, I’m using the following which seems to work:
What was the conclusion on this, I’m running into the same error. I need to override the onAbort function on server?