feat: switch from useFormContext to useRemixFormContext in Input component

This commit is contained in:
Ardeman 2025-02-28 09:12:38 +08:00
parent 0b6b43a951
commit f66ddde6f0

View File

@ -1,12 +1,12 @@
import { useState, type ComponentProps, type ReactNode } from 'react'
import {
get,
useFormContext,
type FieldError,
type FieldValues,
type Path,
type RegisterOptions,
} from 'react-hook-form'
import { useRemixFormContext } from 'remix-hook-form'
import { EyeIcon } from '~/components/icons/eye'
@ -31,7 +31,7 @@ export const Input = <TFormValues extends Record<string, unknown>>(
const {
register,
formState: { errors },
} = useFormContext()
} = useRemixFormContext()
const error: FieldError = get(errors, name)