@geee-be/react-utils 1.1.6 → 1.1.8
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
CHANGED
@@ -1,5 +1,17 @@
|
|
1
1
|
# @geee-be/react-utils
|
2
2
|
|
3
|
+
## 1.1.8
|
4
|
+
|
5
|
+
### Patch Changes
|
6
|
+
|
7
|
+
- 1aee5a6: feat: enable client-side rendering in client-only helper
|
8
|
+
|
9
|
+
## 1.1.7
|
10
|
+
|
11
|
+
### Patch Changes
|
12
|
+
|
13
|
+
- 3ca7ee9: feat: add ClientOnly component for client-side rendering
|
14
|
+
|
3
15
|
## 1.1.6
|
4
16
|
|
5
17
|
### Patch Changes
|
@@ -0,0 +1,9 @@
|
|
1
|
+
'use client';
|
2
|
+
import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
3
|
+
import { useIsClient } from '../hooks';
|
4
|
+
export const ClientOnly = ({ children, serverFallback }) => {
|
5
|
+
const isClient = useIsClient();
|
6
|
+
if (isClient)
|
7
|
+
return _jsx(_Fragment, { children: serverFallback });
|
8
|
+
return _jsx(_Fragment, { children: children });
|
9
|
+
};
|
package/dist/helpers/index.js
CHANGED
package/package.json
CHANGED
@@ -0,0 +1,14 @@
|
|
1
|
+
'use client';
|
2
|
+
|
3
|
+
import type { FC, PropsWithChildren, ReactNode } from 'react';
|
4
|
+
import { useIsClient } from '../hooks';
|
5
|
+
|
6
|
+
interface Props extends PropsWithChildren {
|
7
|
+
serverFallback?: ReactNode;
|
8
|
+
}
|
9
|
+
|
10
|
+
export const ClientOnly: FC<Props> = ({ children, serverFallback }) => {
|
11
|
+
const isClient = useIsClient();
|
12
|
+
if (isClient) return <>{serverFallback}</>;
|
13
|
+
return <>{children}</>;
|
14
|
+
};
|
package/src/helpers/index.ts
CHANGED
File without changes
|