@geee-be/react-utils 1.1.9 → 1.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/CHANGELOG.md +12 -0
- package/dist/helpers/index.js +1 -0
- package/dist/helpers/monitor.js +13 -0
- package/package.json +17 -14
- package/src/helpers/index.ts +1 -0
- package/src/helpers/monitor.tsx +18 -0
package/CHANGELOG.md
CHANGED
package/dist/helpers/index.js
CHANGED
@@ -0,0 +1,13 @@
|
|
1
|
+
'use client';
|
2
|
+
import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
3
|
+
import { useRenderCount } from '@uidotdev/usehooks';
|
4
|
+
import { useEffect } from 'react';
|
5
|
+
export const Monitor = ({ children, label }) => {
|
6
|
+
useEffect(() => {
|
7
|
+
console.log(label, 'mounted');
|
8
|
+
return () => console.log(label, 'unmounted');
|
9
|
+
}, [label]);
|
10
|
+
const count = useRenderCount();
|
11
|
+
console.log(label, 'rendered', count);
|
12
|
+
return _jsx(_Fragment, { children: children });
|
13
|
+
};
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@geee-be/react-utils",
|
3
|
-
"version": "1.
|
3
|
+
"version": "1.2.0",
|
4
4
|
"description": "",
|
5
5
|
"keywords": [],
|
6
6
|
"license": "MIT",
|
@@ -9,25 +9,28 @@
|
|
9
9
|
"main": "dist/index.js",
|
10
10
|
"types": "src/index.ts",
|
11
11
|
"devDependencies": {
|
12
|
-
"@storybook/addon-essentials": "^7.6.
|
13
|
-
"@storybook/addon-interactions": "^7.6.
|
14
|
-
"@storybook/addon-links": "^7.6.
|
15
|
-
"@storybook/addon-onboarding": "^1.0.
|
16
|
-
"@storybook/blocks": "^7.6.
|
17
|
-
"@storybook/react": "^7.6.
|
18
|
-
"@storybook/react-vite": "^7.6.
|
19
|
-
"@storybook/test": "^7.6.
|
20
|
-
"@types/react": "^18.
|
21
|
-
"@types/react-dom": "^18.
|
12
|
+
"@storybook/addon-essentials": "^7.6.20",
|
13
|
+
"@storybook/addon-interactions": "^7.6.20",
|
14
|
+
"@storybook/addon-links": "^7.6.20",
|
15
|
+
"@storybook/addon-onboarding": "^1.0.11",
|
16
|
+
"@storybook/blocks": "^7.6.20",
|
17
|
+
"@storybook/react": "^7.6.20",
|
18
|
+
"@storybook/react-vite": "^7.6.20",
|
19
|
+
"@storybook/test": "^7.6.20",
|
20
|
+
"@types/react": "^18.3.12",
|
21
|
+
"@types/react-dom": "^18.3.1",
|
22
22
|
"prop-types": "^15.8.1",
|
23
|
-
"react": "^18.
|
24
|
-
"react-dom": "^18.
|
25
|
-
"storybook": "^7.6.
|
23
|
+
"react": "^18.3.1",
|
24
|
+
"react-dom": "^18.3.1",
|
25
|
+
"storybook": "^7.6.20"
|
26
26
|
},
|
27
27
|
"peerDependencies": {
|
28
28
|
"react": ">=18.0.0",
|
29
29
|
"react-dom": ">=18.0.0"
|
30
30
|
},
|
31
|
+
"dependencies": {
|
32
|
+
"@uidotdev/usehooks": "^2.4.1"
|
33
|
+
},
|
31
34
|
"scripts": {
|
32
35
|
"prebuild": "rimraf dist/*",
|
33
36
|
"build": "tsc",
|
package/src/helpers/index.ts
CHANGED
@@ -0,0 +1,18 @@
|
|
1
|
+
'use client';
|
2
|
+
|
3
|
+
import { useRenderCount } from '@uidotdev/usehooks';
|
4
|
+
import { useEffect, type FC, type PropsWithChildren } from 'react';
|
5
|
+
|
6
|
+
type Props = PropsWithChildren<{ label: string }>;
|
7
|
+
|
8
|
+
export const Monitor: FC<Props> = ({ children, label }) => {
|
9
|
+
useEffect(() => {
|
10
|
+
console.log(label, 'mounted');
|
11
|
+
return () => console.log(label, 'unmounted');
|
12
|
+
}, [label]);
|
13
|
+
|
14
|
+
const count = useRenderCount();
|
15
|
+
console.log(label, 'rendered', count);
|
16
|
+
|
17
|
+
return <>{children}</>;
|
18
|
+
};
|