Closed pboissonneault closed 3 years ago
What I've done to fix it :
routeExists() {
return this.routes.filter((route) => {
if(route.path !== path) {
let match = matchPath(path, {exact: false, path: route.path});
return (match !== null) && (Object.keys(match.params).length > 0)
}
return (route.path === path);
}).length > 0;
}
It seems already fixed in master, but the npm package is v.0.4.3 but it's different from this repo.
Hi mate, I think this issue came up previously - are you saying it's fixed on the master branch, but that fix isn't present in the npm package?
Exactly
The DefaultRoute is loaded even when a route exists. This only happens when a route with params is used.
Ex. :
Home and Works are loaded as expected. When the route /messages/:lang is loaded, it works, but the DefaultRoute is loaded too.