Skip to content

Commit b189d87

Browse files
KefirNotolegman
authored andcommitted
избавление от лишних слешей вначале path (#5)
1 parent aae97db commit b189d87

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/browser-router.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ export default class BrowserRouter extends Router {
2323
}
2424
}
2525
static async init(opts: initParams): Promise<initResult> {
26-
opts.path = opts.history.location.pathname + opts.history.location.search + opts.history.location.hash;
26+
const { pathname, search, hash } = opts.history.location;
27+
opts.path = `${pathname}${search}${hash}`.replace(/^(\/)+/, '/');
2728
const result = await super.init(opts);
2829
return {
2930
...result,

0 commit comments

Comments
 (0)