Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make Link and NavLink components accept "to" property as a function (#…
- Loading branch information
1 parent
1ad731a
commit bb802cd
Showing
7 changed files
with
164 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,26 @@ | ||
{ | ||
"esm/react-router-dom.js": { | ||
"bundled": 8362, | ||
"minified": 5058, | ||
"gzipped": 1651, | ||
"bundled": 8874, | ||
"minified": 5312, | ||
"gzipped": 1711, | ||
"treeshaked": { | ||
"rollup": { | ||
"code": 453, | ||
"code": 508, | ||
"import_statements": 417 | ||
}, | ||
"webpack": { | ||
"code": 1661 | ||
"code": 1800 | ||
} | ||
} | ||
}, | ||
"umd/react-router-dom.js": { | ||
"bundled": 159395, | ||
"minified": 56787, | ||
"gzipped": 16387 | ||
"bundled": 159933, | ||
"minified": 56923, | ||
"gzipped": 16433 | ||
}, | ||
"umd/react-router-dom.min.js": { | ||
"bundled": 96151, | ||
"minified": 33747, | ||
"gzipped": 9951 | ||
"bundled": 96671, | ||
"minified": 33875, | ||
"gzipped": 9980 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { createLocation } from "history"; | ||
|
||
export const resolveToLocation = (to, currentLocation) => | ||
typeof to === "function" ? to(currentLocation) : to; | ||
|
||
export const normalizeToLocation = (to, currentLocation) => { | ||
return typeof to === "string" | ||
? createLocation(to, null, null, currentLocation) | ||
: to; | ||
}; |