@pushwoosh/dumb-components 1.0.6 → 1.0.7

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.
@@ -1,5 +1,5 @@
1
1
  import { useMemo, useRef } from 'react';
2
- import { useNavigate, useLocation } from 'react-router-dom';
2
+ import { useHistory, useLocation } from 'react-router-dom';
3
3
  import { usePersistentFunction } from '@pushwoosh/kit-helpers';
4
4
  function pickBy(obj) {
5
5
  return Object.fromEntries(Object.entries(obj).filter(([, value]) => !!value));
@@ -10,7 +10,7 @@ export function useDataTableParams({
10
10
  defaultPerPage = 10,
11
11
  extend
12
12
  }) {
13
- const navigate = useNavigate();
13
+ const history = useHistory();
14
14
  const {
15
15
  search: locationSearch
16
16
  } = useLocation();
@@ -31,7 +31,7 @@ export function useDataTableParams({
31
31
  return extendRef.current ? extendRef.current(obj, params) : params;
32
32
  }, [locationSearch, defaultDirection, defaultOrder, defaultPerPage]);
33
33
  const changeDataTableParams = usePersistentFunction(params => {
34
- navigate({
34
+ history.push({
35
35
  search: new URLSearchParams(pickBy(params)).toString()
36
36
  });
37
37
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pushwoosh/dumb-components",
3
- "version": "1.0.6",
3
+ "version": "1.0.7",
4
4
  "description": "React components to build Pushwoosh products",
5
5
  "main": "index.js",
6
6
  "module": "index.js",
@@ -15,6 +15,10 @@
15
15
  "check:types": "echo \"Run check:types\" && pushwoosh-engine lib:check-types"
16
16
  },
17
17
  "pre-commit": "check",
18
+ "engines": {
19
+ "node": ">= 18",
20
+ "npm": ">= 7"
21
+ },
18
22
  "devDependencies": {
19
23
  "@pushwoosh/frontend-builder-engine": "^1.0.15",
20
24
  "@pushwoosh/kit-constants": "^1.6.7",
@@ -24,21 +28,12 @@
24
28
  "@types/react-dom": "^18.2.22",
25
29
  "@types/react-transition-group": "^4.4.12",
26
30
  "@types/styled-components": "^5.1.34",
31
+ "@types/react-router-dom": "^5.3.3",
27
32
  "pre-commit": "^1.2.2",
28
33
  "react": "^18.2.0",
29
34
  "react-dom": "^18.2.0",
30
- "react-router-dom": "^6.22.3",
31
35
  "styled-components": "^5.3.11"
32
36
  },
33
- "peerDependencies": {
34
- "@pushwoosh/kit-constants": "^1.6.0",
35
- "react": ">= 16.14.0",
36
- "styled-components": "^5.3.3 || ^6.0.0"
37
- },
38
- "engines": {
39
- "node": ">= 18",
40
- "npm": ">= 7"
41
- },
42
37
  "dependencies": {
43
38
  "@pushwoosh/kit-helpers": "^4.6.2",
44
39
  "@pushwoosh/kit-icons": "^2.1.1",
@@ -49,5 +44,11 @@
49
44
  "polished": "^4.3.1",
50
45
  "react-select": "^5.10.0",
51
46
  "react-transition-group": "^4.4.5"
47
+ },
48
+ "peerDependencies": {
49
+ "@pushwoosh/kit-constants": "^1.6.0",
50
+ "react": ">= 16.14.0",
51
+ "react-router-dom": "^5.3.4",
52
+ "styled-components": "^5.3.3 || ^6.0.0"
52
53
  }
53
54
  }