diff --git a/hooks/queries/use-user-query.ts b/hooks/queries/use-user-query.ts new file mode 100644 index 0000000..9cb4c00 --- /dev/null +++ b/hooks/queries/use-user-query.ts @@ -0,0 +1,42 @@ +import { useQuery } from "@tanstack/react-query"; +import { createClient } from "@/utils/supabase/client"; + +/** + * [사용자 정보 조회 쿼리] + * + * 현재 로그인한 사용자의 정보를 조회합니다. + * - 자동 캐싱 및 재검증 + * - 로딩/에러 상태 자동 관리 + * + * @example + * ```tsx + * import { useUserQuery } from '@/hooks/queries/use-user-query'; + * + * function Profile() { + * const { data: user, isLoading, error } = useUserQuery(); + * + * if (isLoading) return