@yamada-ui/react
Version:
React UI components of the Yamada, by the Yamada, for the Yamada built with React and Emotion
24 lines (20 loc) • 590 B
JavaScript
"use client";
import { useMounted } from "../../hooks/use-mounted/index.js";
import { Show } from "../show/show.js";
import { jsx } from "react/jsx-runtime";
//#region src/components/client-only/client-only.tsx
/**
* `ClientOnly` is a component that renders its children only on the client side.
*
* @see https://yamada-ui.com/docs/components/client-only
*/
const ClientOnly = ({ children, fallback }) => {
return /* @__PURE__ */ jsx(Show, {
fallback,
when: useMounted({ state: true }),
children
});
};
//#endregion
export { ClientOnly };
//# sourceMappingURL=client-only.js.map