@unovis/react 1.0.3-beta.0 → 1.1.0-beta.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/package.json +3 -5
- package/utils/react.js +3 -3
- package/utils/react.js.map +1 -1
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unovis/react",
|
|
3
3
|
"description": "Modular data visualization framework for React, Angular, Svelte, and vanilla TypeScript or JavaScript",
|
|
4
|
-
"version": "1.0
|
|
4
|
+
"version": "1.1.0-beta.0",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "https://github.com/f5/unovis.git",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
},
|
|
37
37
|
"peerDependencies": {
|
|
38
38
|
"@emotion/css": "^11.7.1",
|
|
39
|
-
"@unovis/ts": "1.0
|
|
39
|
+
"@unovis/ts": "1.1.0-beta.0",
|
|
40
40
|
"react": ">=16.8.0 || ^17 || ^18",
|
|
41
41
|
"react-dom": ">=16.8.0 || ^17 || ^18"
|
|
42
42
|
},
|
|
@@ -57,7 +57,5 @@
|
|
|
57
57
|
"ttypescript": "^1.5.13",
|
|
58
58
|
"typescript": "~4.2.4"
|
|
59
59
|
},
|
|
60
|
-
"dependencies": {
|
|
61
|
-
"lodash-es": "^4.17.21"
|
|
62
|
-
}
|
|
60
|
+
"dependencies": {}
|
|
63
61
|
}
|
package/utils/react.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { isEqual } from '@unovis/ts';
|
|
2
2
|
|
|
3
3
|
function arePropsEqual(prevProps, nextProps) {
|
|
4
4
|
if (typeof prevProps.children !== typeof nextProps.children)
|
|
@@ -9,7 +9,7 @@ function arePropsEqual(prevProps, nextProps) {
|
|
|
9
9
|
if (prevChildren.length !== nextChildren.length)
|
|
10
10
|
return false;
|
|
11
11
|
for (let i = 0; i < nextChildren.length; i += 1) {
|
|
12
|
-
if (!
|
|
12
|
+
if (!isEqual(prevChildren[i].props, nextChildren[i].props))
|
|
13
13
|
return false;
|
|
14
14
|
}
|
|
15
15
|
}
|
|
@@ -17,7 +17,7 @@ function arePropsEqual(prevProps, nextProps) {
|
|
|
17
17
|
for (const key of propKeys) {
|
|
18
18
|
if (key === 'children')
|
|
19
19
|
continue;
|
|
20
|
-
if (!(
|
|
20
|
+
if (!(isEqual(prevProps[key], nextProps[key])))
|
|
21
21
|
return false;
|
|
22
22
|
}
|
|
23
23
|
return true;
|
package/utils/react.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react.js","sources":["../../src/utils/react.ts"],"sourcesContent":["import { ReactElement, ReactNode } from 'react'\nimport
|
|
1
|
+
{"version":3,"file":"react.js","sources":["../../src/utils/react.ts"],"sourcesContent":["import { ReactElement, ReactNode } from 'react'\nimport { isEqual } from '@unovis/ts'\n\nexport function arePropsEqual<PropTypes extends { children?: ReactNode }> (prevProps: PropTypes, nextProps: PropTypes): boolean {\n if (typeof prevProps.children !== typeof nextProps.children) return false\n\n if (Array.isArray(prevProps.children) && Array.isArray(nextProps.children)) {\n const prevChildren = prevProps.children as ReactElement[]\n const nextChildren = nextProps.children as ReactElement[]\n if (prevChildren.length !== nextChildren.length) return false\n\n for (let i = 0; i < nextChildren.length; i += 1) {\n if (!isEqual(prevChildren[i].props, nextChildren[i].props)) return false\n }\n }\n\n const propKeys = Array.from(new Set([...Object.keys(prevProps), ...Object.keys(nextProps)])) as (keyof PropTypes)[]\n for (const key of propKeys) {\n if (key === 'children') continue\n if (!(isEqual(prevProps[key], nextProps[key]))) return false\n }\n\n return true\n}\n"],"names":[],"mappings":";;AAGgB,SAAA,aAAa,CAA8C,SAAoB,EAAE,SAAoB,EAAA;IACnH,IAAI,OAAO,SAAS,CAAC,QAAQ,KAAK,OAAO,SAAS,CAAC,QAAQ;AAAE,QAAA,OAAO,KAAK,CAAA;AAEzE,IAAA,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