@geee-be/react-utils 1.1.8 → 1.1.9
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
@@ -3,7 +3,7 @@ import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
|
3
3
|
import { useIsClient } from '../hooks';
|
4
4
|
export const ClientOnly = ({ children, serverFallback }) => {
|
5
5
|
const isClient = useIsClient();
|
6
|
-
if (isClient)
|
6
|
+
if (!isClient)
|
7
7
|
return _jsx(_Fragment, { children: serverFallback });
|
8
8
|
return _jsx(_Fragment, { children: children });
|
9
9
|
};
|
package/package.json
CHANGED
@@ -9,6 +9,6 @@ interface Props extends PropsWithChildren {
|
|
9
9
|
|
10
10
|
export const ClientOnly: FC<Props> = ({ children, serverFallback }) => {
|
11
11
|
const isClient = useIsClient();
|
12
|
-
if (isClient) return <>{serverFallback}</>;
|
12
|
+
if (!isClient) return <>{serverFallback}</>;
|
13
13
|
return <>{children}</>;
|
14
14
|
};
|