We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3c2e244 commit 6c8eaf6Copy full SHA for 6c8eaf6
packages/react-router/lib/router/router.ts
@@ -866,7 +866,10 @@ export function createRouter(init: RouterInit): Router {
866
manifest,
867
);
868
let inFlightDataRoutes: AgnosticDataRouteObject[] | undefined;
869
- let basename = init.basename?.replace(/^\/*/, "/") || "/"; // ensure leading slash
+ let basename = init.basename || "/";
870
+ if (!basename.startsWith("/")) {
871
+ basename = `/${basename}`;
872
+ }
873
let dataStrategyImpl = init.dataStrategy || defaultDataStrategyWithMiddleware;
874
875
// Config driven behavior flags
0 commit comments