@geee-be/react-utils 1.1.3 → 1.1.5
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/sub-component.js +3 -0
- package/dist/hooks/index.js +1 -0
- package/dist/hooks/use-is-client.js +8 -0
- package/dist/hooks/use-local-state.stories.js +1 -1
- package/package.json +1 -1
- package/src/helpers/index.ts +1 -0
- package/src/helpers/sub-component.tsx +12 -0
- package/src/hooks/index.ts +1 -0
- package/src/hooks/use-is-client.ts +11 -0
- package/src/hooks/use-local-state.stories.tsx +1 -1
package/CHANGELOG.md
CHANGED
@@ -1,5 +1,17 @@
|
|
1
1
|
# @geee-be/react-utils
|
2
2
|
|
3
|
+
## 1.1.5
|
4
|
+
|
5
|
+
### Patch Changes
|
6
|
+
|
7
|
+
- 70692ad: Use skeleton for input image on initial server render
|
8
|
+
|
9
|
+
## 1.1.4
|
10
|
+
|
11
|
+
### Patch Changes
|
12
|
+
|
13
|
+
- 464eb24: Trial sub components with Card
|
14
|
+
|
3
15
|
## 1.1.3
|
4
16
|
|
5
17
|
### Patch Changes
|
package/dist/helpers/index.js
CHANGED
package/dist/hooks/index.js
CHANGED
@@ -10,6 +10,6 @@ export const Primary = {
|
|
10
10
|
val: 1,
|
11
11
|
});
|
12
12
|
console.log('render', value);
|
13
|
-
return (_jsxs("div", { children: [JSON.stringify(value), _jsx("button", { type: "button", onClick: () => setValue((prev) => ({ val: prev.val + 1
|
13
|
+
return (_jsxs("div", { children: [JSON.stringify(value), _jsx("button", { type: "button", onClick: () => setValue((prev) => ({ val: prev.val + 1 })), children: "Inc" })] }));
|
14
14
|
},
|
15
15
|
};
|
package/package.json
CHANGED
package/src/helpers/index.ts
CHANGED
@@ -0,0 +1,12 @@
|
|
1
|
+
import { type ComponentType, forwardRef } from 'react';
|
2
|
+
|
3
|
+
export const withSubComponents = <P extends {}, S>(
|
4
|
+
RootComponent: ComponentType<P>,
|
5
|
+
subComponents: S,
|
6
|
+
) =>
|
7
|
+
Object.assign(
|
8
|
+
forwardRef<unknown, P>((props: any, ref: any) => (
|
9
|
+
<RootComponent {...props} ref={ref} />
|
10
|
+
)),
|
11
|
+
subComponents,
|
12
|
+
);
|
package/src/hooks/index.ts
CHANGED