You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have an application that uses the basePath prop to prefix all the routes. However, when we navigate to the root URL, we get a 404 error since the basePath is not prefixed (e.g., when basePath is 'base', localhost:8080/ and localhost:8080/base show a 404 since we do not end up on localhost:8080/base/).
To get around this issue, we added a patch fix with a rootPaths prop, which ignores the basePath for certain routes (/, and /base in our case), and we were wondering if we could upstream this change or if there is a better way to fix this.
Our patch fix (no basePath if rootPaths includes pathname in this line): const matchedRoute = rootPaths.includes(pathname) ? execRouteMatching(routes[i], pathname, queryParamObject, '') : execRouteMatching(routes[i], pathname, queryParamObject, basePath);
The text was updated successfully, but these errors were encountered:
upreeti
changed the title
Navigation of root paths with 'basePath
Navigation of root paths with 'basePath' prop
Dec 16, 2024
We have an application that uses the
basePath
prop to prefix all the routes. However, when we navigate to the root URL, we get a 404 error since the basePath is not prefixed (e.g., whenbasePath
is 'base',localhost:8080/
andlocalhost:8080/base
show a 404 since we do not end up onlocalhost:8080/base/
).To get around this issue, we added a patch fix with a rootPaths prop, which ignores the basePath for certain routes (
/
, and/base
in our case), and we were wondering if we could upstream this change or if there is a better way to fix this.Our patch fix (no
basePath
ifrootPaths
includes pathname in this line):const matchedRoute = rootPaths.includes(pathname) ? execRouteMatching(routes[i], pathname, queryParamObject, '') : execRouteMatching(routes[i], pathname, queryParamObject, basePath);
The text was updated successfully, but these errors were encountered: