react-router 0.0.0-experimental-d90c8fb3 → 0.0.0-experimental-e7ce8959
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/dist/index.js +2 -21
- package/dist/index.js.map +1 -1
- package/dist/main.js +1 -1
- package/dist/react-router.development.js +2 -21
- package/dist/react-router.development.js.map +1 -1
- package/dist/react-router.production.min.js +2 -2
- package/dist/react-router.production.min.js.map +1 -1
- package/dist/umd/react-router.development.js +2 -21
- package/dist/umd/react-router.development.js.map +1 -1
- package/dist/umd/react-router.production.min.js +2 -2
- package/dist/umd/react-router.production.min.js.map +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* React Router v0.0.0-experimental-
|
|
2
|
+
* React Router v0.0.0-experimental-e7ce8959
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -372,26 +372,7 @@ function useRoutesImpl(routes, locationArg, dataRouterState, future) {
|
|
|
372
372
|
location = locationFromContext;
|
|
373
373
|
}
|
|
374
374
|
let pathname = location.pathname || "/";
|
|
375
|
-
let remainingPathname = pathname;
|
|
376
|
-
if (parentPathnameBase !== "/") {
|
|
377
|
-
// Determine the remaining pathname by removing the # of URL segments the
|
|
378
|
-
// parentPathnameBase has, instead of removing based on character count.
|
|
379
|
-
// This is because we can't guarantee that incoming/outgoing encodings/
|
|
380
|
-
// decodings will match exactly.
|
|
381
|
-
// We decode paths before matching on a per-segment basis with
|
|
382
|
-
// decodeURIComponent(), but we re-encode pathnames via `new URL()` so they
|
|
383
|
-
// match what `window.location.pathname` would reflect. Those don't 100%
|
|
384
|
-
// align when it comes to encoded URI characters such as % and &.
|
|
385
|
-
//
|
|
386
|
-
// So we may end up with:
|
|
387
|
-
// pathname: "/descendant/a%25b/match"
|
|
388
|
-
// parentPathnameBase: "/descendant/a%b"
|
|
389
|
-
//
|
|
390
|
-
// And the direct substring removal approach won't work :/
|
|
391
|
-
let parentSegments = parentPathnameBase.replace(/^\//, "").split("/");
|
|
392
|
-
let segments = pathname.replace(/^\//, "").split("/");
|
|
393
|
-
remainingPathname = "/" + segments.slice(parentSegments.length).join("/");
|
|
394
|
-
}
|
|
375
|
+
let remainingPathname = parentPathnameBase === "/" ? pathname : pathname.slice(parentPathnameBase.length) || "/";
|
|
395
376
|
let matches = matchRoutes(routes, {
|
|
396
377
|
pathname: remainingPathname
|
|
397
378
|
});
|