Update @hookform/resolvers
In v5 the zod resolver will automatically infer the type for `useForm`. It's not recommended to manually specify types. See https://github.com/react-hook-form/resolvers/releases/tag/v5.0.0
This commit is contained in:
@@ -18,8 +18,6 @@ import { getMultiroomDetailsSchema } from "./schema"
|
||||
|
||||
import styles from "./details.module.css"
|
||||
|
||||
import type { MultiroomDetailsSchema } from "@/types/components/hotelReservation/enterDetails/details"
|
||||
|
||||
const formID = "enter-details"
|
||||
export default function Details() {
|
||||
const intl = useIntl()
|
||||
@@ -53,7 +51,7 @@ export default function Details() {
|
||||
[idx, rooms]
|
||||
)
|
||||
|
||||
const methods = useForm<MultiroomDetailsSchema>({
|
||||
const methods = useForm({
|
||||
criteriaMode: "all",
|
||||
mode: "all",
|
||||
resolver: zodResolver(getMultiroomDetailsSchema(crossValidationData)),
|
||||
|
||||
@@ -43,7 +43,7 @@ export default function Details({ user }: DetailsProps) {
|
||||
|
||||
const memberRate = "member" in room.roomRate ? room.roomRate.member : null
|
||||
|
||||
const methods = useForm<DetailsSchema>({
|
||||
const methods = useForm({
|
||||
criteriaMode: "all",
|
||||
mode: "all",
|
||||
resolver: zodResolver(user ? signedInDetailsSchema : guestDetailsSchema),
|
||||
|
||||
Reference in New Issue
Block a user