react-router-dom 5.0.1 → 5.2.0
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/cjs/react-router-dom.js +221 -72
- package/cjs/react-router-dom.js.map +1 -0
- package/cjs/react-router-dom.min.js +2 -1
- package/cjs/react-router-dom.min.js.map +1 -0
- package/es/BrowserRouter.js +0 -2
- package/es/HashRouter.js +0 -2
- package/es/Link.js +0 -2
- package/es/MemoryRouter.js +0 -2
- package/es/NavLink.js +0 -2
- package/es/Prompt.js +0 -2
- package/es/Redirect.js +0 -2
- package/es/Route.js +0 -2
- package/es/Router.js +0 -2
- package/es/StaticRouter.js +0 -2
- package/es/Switch.js +0 -2
- package/es/generatePath.js +0 -2
- package/es/matchPath.js +0 -2
- package/es/warnAboutDeprecatedESMImport.js +1 -2
- package/es/withRouter.js +0 -2
- package/esm/react-router-dom.js +135 -69
- package/esm/react-router-dom.js.map +1 -0
- package/modules/BrowserRouter.js +36 -0
- package/modules/HashRouter.js +35 -0
- package/modules/Link.js +146 -0
- package/modules/NavLink.js +125 -0
- package/modules/index.js +21 -0
- package/modules/utils/locationUtils.js +10 -0
- package/package.json +7 -35
- package/umd/react-router-dom.js +3968 -4897
- package/umd/react-router-dom.js.map +1 -0
- package/umd/react-router-dom.min.js +2 -1
- package/umd/react-router-dom.min.js.map +1 -0
- package/warnAboutDeprecatedCJSRequire.js +1 -0
package/modules/index.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export {
|
|
2
|
+
MemoryRouter,
|
|
3
|
+
Prompt,
|
|
4
|
+
Redirect,
|
|
5
|
+
Route,
|
|
6
|
+
Router,
|
|
7
|
+
StaticRouter,
|
|
8
|
+
Switch,
|
|
9
|
+
generatePath,
|
|
10
|
+
matchPath,
|
|
11
|
+
withRouter,
|
|
12
|
+
useHistory,
|
|
13
|
+
useLocation,
|
|
14
|
+
useParams,
|
|
15
|
+
useRouteMatch
|
|
16
|
+
} from "react-router";
|
|
17
|
+
|
|
18
|
+
export { default as BrowserRouter } from "./BrowserRouter.js";
|
|
19
|
+
export { default as HashRouter } from "./HashRouter.js";
|
|
20
|
+
export { default as Link } from "./Link.js";
|
|
21
|
+
export { default as NavLink } from "./NavLink.js";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { createLocation } from "history";
|
|
2
|
+
|
|
3
|
+
export const resolveToLocation = (to, currentLocation) =>
|
|
4
|
+
typeof to === "function" ? to(currentLocation) : to;
|
|
5
|
+
|
|
6
|
+
export const normalizeToLocation = (to, currentLocation) => {
|
|
7
|
+
return typeof to === "string"
|
|
8
|
+
? createLocation(to, null, null, currentLocation)
|
|
9
|
+
: to;
|
|
10
|
+
};
|
package/package.json
CHANGED
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-router-dom",
|
|
3
|
-
"version": "5.0
|
|
3
|
+
"version": "5.2.0",
|
|
4
4
|
"description": "DOM bindings for React Router",
|
|
5
5
|
"repository": "ReactTraining/react-router",
|
|
6
6
|
"license": "MIT",
|
|
7
|
-
"
|
|
8
|
-
"Michael Jackson",
|
|
9
|
-
"Ryan Florence"
|
|
10
|
-
],
|
|
7
|
+
"author": "React Training <hello@reacttraining.com>",
|
|
11
8
|
"files": [
|
|
12
9
|
"BrowserRouter.js",
|
|
13
10
|
"HashRouter.js",
|
|
@@ -26,6 +23,8 @@
|
|
|
26
23
|
"index.js",
|
|
27
24
|
"generatePath.js",
|
|
28
25
|
"matchPath.js",
|
|
26
|
+
"modules/*.js",
|
|
27
|
+
"modules/utils/*.js",
|
|
29
28
|
"withRouter.js",
|
|
30
29
|
"warnAboutDeprecatedCJSRequire.js",
|
|
31
30
|
"umd"
|
|
@@ -35,9 +34,7 @@
|
|
|
35
34
|
"sideEffects": false,
|
|
36
35
|
"scripts": {
|
|
37
36
|
"build": "rollup -c",
|
|
38
|
-
"lint": "eslint modules"
|
|
39
|
-
"prepublishOnly": "npm run build",
|
|
40
|
-
"test": "jest"
|
|
37
|
+
"lint": "eslint modules"
|
|
41
38
|
},
|
|
42
39
|
"peerDependencies": {
|
|
43
40
|
"react": ">=15"
|
|
@@ -47,35 +44,10 @@
|
|
|
47
44
|
"history": "^4.9.0",
|
|
48
45
|
"loose-envify": "^1.3.1",
|
|
49
46
|
"prop-types": "^15.6.2",
|
|
50
|
-
"react-router": "5.0
|
|
47
|
+
"react-router": "5.2.0",
|
|
51
48
|
"tiny-invariant": "^1.0.2",
|
|
52
49
|
"tiny-warning": "^1.0.0"
|
|
53
50
|
},
|
|
54
|
-
"devDependencies": {
|
|
55
|
-
"@babel/core": "^7.1.2",
|
|
56
|
-
"@babel/plugin-proposal-class-properties": "^7.1.0",
|
|
57
|
-
"@babel/plugin-transform-runtime": "^7.1.0",
|
|
58
|
-
"@babel/preset-env": "^7.1.0",
|
|
59
|
-
"@babel/preset-react": "^7.0.0",
|
|
60
|
-
"babel-eslint": "^10.0.1",
|
|
61
|
-
"babel-jest": "^24.8.0",
|
|
62
|
-
"babel-plugin-dev-expression": "^0.2.1",
|
|
63
|
-
"eslint": "^5.16.0",
|
|
64
|
-
"eslint-plugin-import": "^2.17.0",
|
|
65
|
-
"eslint-plugin-react": "^7.9.1",
|
|
66
|
-
"jest": "^24.8.0",
|
|
67
|
-
"jest-circus": "^24.8.0",
|
|
68
|
-
"raf": "^3.4.1",
|
|
69
|
-
"react": "^16.5.2",
|
|
70
|
-
"react-dom": "^16.5.2",
|
|
71
|
-
"rollup": "^0.66.6",
|
|
72
|
-
"rollup-plugin-babel": "^4.3.2",
|
|
73
|
-
"rollup-plugin-commonjs": "^9.3.4",
|
|
74
|
-
"rollup-plugin-node-resolve": "^3.4.0",
|
|
75
|
-
"rollup-plugin-replace": "^2.2.0",
|
|
76
|
-
"rollup-plugin-size-snapshot": "0.7.0",
|
|
77
|
-
"rollup-plugin-uglify": "^6.0.2"
|
|
78
|
-
},
|
|
79
51
|
"browserify": {
|
|
80
52
|
"transform": [
|
|
81
53
|
"loose-envify"
|
|
@@ -89,5 +61,5 @@
|
|
|
89
61
|
"history",
|
|
90
62
|
"link"
|
|
91
63
|
],
|
|
92
|
-
"gitHead": "
|
|
64
|
+
"gitHead": "21a62e55c0d6196002bd4ab5b3350514976928cf"
|
|
93
65
|
}
|