[as] feat: "@hookform/devtools" 추가

This commit is contained in:
2026-09-21 16:04:19 +09:00
parent 342db06685
commit 23ebf36244
8 changed files with 308 additions and 36 deletions
+2 -1
View File
@@ -4,6 +4,7 @@ export type { FileAddButtonProps } from "./file-add-button";
export { FileAddButton } from "./file-add-button";
export { NoData } from "./no-data";
export { PageLayout } from "./page-layout";
export { RhfDevTool } from "./rhf-devtool";
export { SectionCollapsible } from "./section-collapsible";
export {
SectionCollapsibleGroup,
@@ -12,4 +13,4 @@ export {
export type { TextShimmerProps } from "./text-shimmer";
export { TEXT_SHIMMER_CLASS, TextShimmer } from "./text-shimmer";
export type { UploadedFileChipProps } from "./uploaded-file-chip";
export { UploadedFileChip } from "./uploaded-file-chip";
export { UploadedFileChip } from "./uploaded-file-chip";
+17
View File
@@ -0,0 +1,17 @@
"use client";
import type { Control, FieldValues } from "react-hook-form";
import dynamic from "next/dynamic";
const DevTool = dynamic(() => import("@hookform/devtools").then((mod) => mod.DevTool), {
ssr: false,
});
interface RhfDevToolProps<T extends FieldValues> {
control: Control<T>;
}
export function RhfDevTool<T extends FieldValues>({ control }: RhfDevToolProps<T>) {
if (process.env.NODE_ENV !== "development") return null;
return <DevTool control={control as Control<FieldValues>} placement="top-left" />;
}