react-router-scroll-to-top 1.2.0 → 1.2.1
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/README.md +2 -2
- package/index.d.ts +4 -12
- package/lib/index.js +1 -1
- package/package.json +52 -52
package/README.md
CHANGED
|
@@ -23,7 +23,7 @@ import { ScrollToTop } from 'react-router-scroll-to-top';
|
|
|
23
23
|
const App = () => (
|
|
24
24
|
<BrowserRouter>
|
|
25
25
|
<ScrollToTop />
|
|
26
|
-
<
|
|
26
|
+
<Routes>{/* routes */}</Routes>
|
|
27
27
|
</BrowserRouter>
|
|
28
28
|
);
|
|
29
29
|
```
|
|
@@ -32,4 +32,4 @@ Read [the documentation](https://github.com/dimazuien/react-router-scroll-to-top
|
|
|
32
32
|
|
|
33
33
|
## Support
|
|
34
34
|
|
|
35
|
-
If you like this package and want to support it, you can
|
|
35
|
+
If you like this package and want to support it, you can do it on [Patreon](https://www.patreon.com/dimazuien)
|
package/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
declare module 'react-router-scroll-to-top/src/ScrollToTop' {
|
|
1
|
+
declare module 'react-router-scroll-to-top/src/ScrollToTop/index' {
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
3
|
type Props = Readonly<{
|
|
4
4
|
children?: ReactNode;
|
|
@@ -8,22 +8,14 @@ declare module 'react-router-scroll-to-top/src/ScrollToTop' {
|
|
|
8
8
|
|
|
9
9
|
}
|
|
10
10
|
declare module 'react-router-scroll-to-top/src/index' {
|
|
11
|
-
export { default as ScrollToTop } from 'react-router-scroll-to-top/src/ScrollToTop';
|
|
12
|
-
export { default as useScrollToTop } from 'react-router-scroll-to-top/src/useScrollToTop';
|
|
11
|
+
export { default as ScrollToTop } from 'react-router-scroll-to-top/src/ScrollToTop/index';
|
|
12
|
+
export { default as useScrollToTop } from 'react-router-scroll-to-top/src/useScrollToTop/index';
|
|
13
13
|
|
|
14
14
|
}
|
|
15
|
-
declare module 'react-router-scroll-to-top/src/useScrollToTop' {
|
|
15
|
+
declare module 'react-router-scroll-to-top/src/useScrollToTop/index' {
|
|
16
16
|
const useScrollToTop: () => void;
|
|
17
17
|
export default useScrollToTop;
|
|
18
18
|
|
|
19
|
-
}
|
|
20
|
-
declare module 'react-router-scroll-to-top/tests/ScrollToTop.test' {
|
|
21
|
-
import '@testing-library/jest-dom/extend-expect';
|
|
22
|
-
|
|
23
|
-
}
|
|
24
|
-
declare module 'react-router-scroll-to-top/tests/useScrollToTop.test' {
|
|
25
|
-
import '@testing-library/jest-dom/extend-expect';
|
|
26
|
-
|
|
27
19
|
}
|
|
28
20
|
declare module 'react-router-scroll-to-top' {
|
|
29
21
|
import main = require('react-router-scroll-to-top/src/index');
|
package/lib/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! For license information please see index.js.LICENSE.txt */
|
|
2
|
-
!function(e,r){"object"==typeof exports&&"object"==typeof module?module.exports=r():"function"==typeof define&&define.amd?define([],r):"object"==typeof exports?exports["react-router-scroll-to-top"]=r():e["react-router-scroll-to-top"]=r()}(
|
|
2
|
+
!function(e,r){"object"==typeof exports&&"object"==typeof module?module.exports=r():"function"==typeof define&&define.amd?define([],r):"object"==typeof exports?exports["react-router-scroll-to-top"]=r():e["react-router-scroll-to-top"]=r()}(globalThis,(function(){return function(){"use strict";var e={44:function(e,r,o){var t=o(497),n=Symbol.for("react.element"),u=Symbol.for("react.fragment"),c=Object.prototype.hasOwnProperty,f=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};r.Fragment=u,r.jsx=function(e,r,o){var t,u={},l=null,a=null;for(t in void 0!==o&&(l=""+o),void 0!==r.key&&(l=""+r.key),void 0!==r.ref&&(a=r.ref),r)c.call(r,t)&&!i.hasOwnProperty(t)&&(u[t]=r[t]);if(e&&e.defaultProps)for(t in r=e.defaultProps)void 0===u[t]&&(u[t]=r[t]);return{$$typeof:n,type:e,key:l,ref:a,props:u,_owner:f.current}}},598:function(e,r,o){e.exports=o(44)},497:function(e){e.exports=require("react")}},r={};function o(t){var n=r[t];if(void 0!==n)return n.exports;var u=r[t]={exports:{}};return e[t](u,u.exports,o),u.exports}o.d=function(e,r){for(var t in r)o.o(r,t)&&!o.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},o.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var t={};return function(){o.r(t),o.d(t,{ScrollToTop:function(){return c},useScrollToTop:function(){return n}});var e=o(497),r=require("react-router-dom"),n=function(){var o=(0,r.useLocation)(),t=o.pathname,n=o.state;(0,e.useEffect)((function(){!1!==(null==n?void 0:n.scrollToTop)&&window.scrollTo(0,0)}),[t,n])},u=o(598),c=function(r){var o=r.children;return n(),(0,u.jsx)(u.Fragment,{children:e.Children.toArray(o)})}}(),t}()}));
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-router-scroll-to-top",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.1",
|
|
4
4
|
"description": "React component that scrolls to the top of a page when the current location gets changed",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "https://github.com/dimazuien/react-router-scroll-to-top.git"
|
|
8
8
|
},
|
|
9
|
-
"homepage": "https://
|
|
9
|
+
"homepage": "https://github.com/dimazuien/react-router-scroll-to-top#readme",
|
|
10
10
|
"keywords": [
|
|
11
11
|
"react",
|
|
12
12
|
"react router",
|
|
@@ -42,61 +42,61 @@
|
|
|
42
42
|
"postpublish": "pinst --enable"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
|
-
"@babel/core": "7.
|
|
46
|
-
"@babel/preset-env": "7.
|
|
47
|
-
"@babel/preset-react": "7.
|
|
48
|
-
"@babel/preset-typescript": "7.
|
|
49
|
-
"@commitlint/cli": "
|
|
50
|
-
"@commitlint/config-conventional": "
|
|
51
|
-
"@semantic-release/changelog": "6.0.
|
|
52
|
-
"@semantic-release/commit-analyzer": "
|
|
45
|
+
"@babel/core": "7.22.9",
|
|
46
|
+
"@babel/preset-env": "7.22.9",
|
|
47
|
+
"@babel/preset-react": "7.22.5",
|
|
48
|
+
"@babel/preset-typescript": "7.22.5",
|
|
49
|
+
"@commitlint/cli": "17.6.7",
|
|
50
|
+
"@commitlint/config-conventional": "17.6.7",
|
|
51
|
+
"@semantic-release/changelog": "6.0.3",
|
|
52
|
+
"@semantic-release/commit-analyzer": "10.0.1",
|
|
53
53
|
"@semantic-release/git": "10.0.1",
|
|
54
|
-
"@semantic-release/github": "
|
|
55
|
-
"@semantic-release/npm": "
|
|
56
|
-
"@semantic-release/release-notes-generator": "
|
|
57
|
-
"@testing-library/dom": "
|
|
58
|
-
"@testing-library/jest-dom": "5.
|
|
59
|
-
"@testing-library/react": "
|
|
60
|
-
"@testing-library/user-event": "14.
|
|
61
|
-
"@types/jest": "
|
|
62
|
-
"@types/react": "
|
|
63
|
-
"@types/react-dom": "
|
|
54
|
+
"@semantic-release/github": "9.0.4",
|
|
55
|
+
"@semantic-release/npm": "10.0.4",
|
|
56
|
+
"@semantic-release/release-notes-generator": "11.0.4",
|
|
57
|
+
"@testing-library/dom": "9.3.1",
|
|
58
|
+
"@testing-library/jest-dom": "5.17.0",
|
|
59
|
+
"@testing-library/react": "14.0.0",
|
|
60
|
+
"@testing-library/user-event": "14.4.3",
|
|
61
|
+
"@types/jest": "29.5.3",
|
|
62
|
+
"@types/react": "18.2.17",
|
|
63
|
+
"@types/react-dom": "18.2.7",
|
|
64
64
|
"@types/react-router-dom": "5.3.3",
|
|
65
|
-
"@types/testing-library__jest-dom": "5.14.
|
|
66
|
-
"@typescript-eslint/eslint-plugin": "
|
|
67
|
-
"@typescript-eslint/parser": "
|
|
68
|
-
"babel-loader": "
|
|
69
|
-
"commitizen": "4.
|
|
65
|
+
"@types/testing-library__jest-dom": "5.14.9",
|
|
66
|
+
"@typescript-eslint/eslint-plugin": "6.2.0",
|
|
67
|
+
"@typescript-eslint/parser": "6.2.0",
|
|
68
|
+
"babel-loader": "9.1.3",
|
|
69
|
+
"commitizen": "4.3.0",
|
|
70
70
|
"cz-conventional-changelog": "3.3.0",
|
|
71
|
-
"eslint": "8.
|
|
71
|
+
"eslint": "8.46.0",
|
|
72
72
|
"eslint-config-airbnb": "19.0.4",
|
|
73
|
-
"eslint-config-prettier": "8.
|
|
74
|
-
"eslint-plugin-import": "2.
|
|
75
|
-
"eslint-plugin-jest-dom": "
|
|
76
|
-
"eslint-plugin-jsx-a11y": "6.
|
|
77
|
-
"eslint-plugin-prettier": "
|
|
78
|
-
"eslint-plugin-react": "7.
|
|
79
|
-
"eslint-plugin-react-hooks": "4.
|
|
80
|
-
"eslint-plugin-simple-import-sort": "
|
|
81
|
-
"eslint-plugin-testing-library": "5.
|
|
82
|
-
"
|
|
83
|
-
"
|
|
84
|
-
"
|
|
85
|
-
"jest": "
|
|
86
|
-
"lint-staged": "
|
|
87
|
-
"lorem-ipsum": "2.0.
|
|
88
|
-
"npm-dts": "1.3.
|
|
73
|
+
"eslint-config-prettier": "8.9.0",
|
|
74
|
+
"eslint-plugin-import": "2.28.0",
|
|
75
|
+
"eslint-plugin-jest-dom": "5.0.1",
|
|
76
|
+
"eslint-plugin-jsx-a11y": "6.7.1",
|
|
77
|
+
"eslint-plugin-prettier": "5.0.0",
|
|
78
|
+
"eslint-plugin-react": "7.33.1",
|
|
79
|
+
"eslint-plugin-react-hooks": "4.6.0",
|
|
80
|
+
"eslint-plugin-simple-import-sort": "10.0.0",
|
|
81
|
+
"eslint-plugin-testing-library": "5.11.0",
|
|
82
|
+
"github-markdown-css": "5.2.0",
|
|
83
|
+
"husky": "8.0.3",
|
|
84
|
+
"jest": "29.6.2",
|
|
85
|
+
"jest-environment-jsdom": "29.6.2",
|
|
86
|
+
"lint-staged": "13.2.3",
|
|
87
|
+
"lorem-ipsum": "2.0.8",
|
|
88
|
+
"npm-dts": "1.3.12",
|
|
89
89
|
"pinst": "3.0.0",
|
|
90
|
-
"prettier": "
|
|
91
|
-
"react": "18.
|
|
92
|
-
"react-dom": "18.
|
|
93
|
-
"react-router-dom": "6.
|
|
94
|
-
"semantic-release": "
|
|
95
|
-
"ts-jest": "
|
|
96
|
-
"ts-node": "10.
|
|
97
|
-
"typescript": "
|
|
98
|
-
"webpack": "5.
|
|
99
|
-
"webpack-cli": "
|
|
90
|
+
"prettier": "3.0.0",
|
|
91
|
+
"react": "18.2.0",
|
|
92
|
+
"react-dom": "18.2.0",
|
|
93
|
+
"react-router-dom": "6.14.2",
|
|
94
|
+
"semantic-release": "21.0.7",
|
|
95
|
+
"ts-jest": "29.1.1",
|
|
96
|
+
"ts-node": "10.9.1",
|
|
97
|
+
"typescript": "5.1.6",
|
|
98
|
+
"webpack": "5.88.2",
|
|
99
|
+
"webpack-cli": "5.1.4"
|
|
100
100
|
},
|
|
101
101
|
"peerDependencies": {
|
|
102
102
|
"react": "^16.8 || ^17 || ^18",
|