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:
@@ -113,7 +113,7 @@ export default function BookingWidgetClient({
|
|||||||
},
|
},
|
||||||
]
|
]
|
||||||
const hotelId = isNaN(+params.hotelId) ? undefined : +params.hotelId
|
const hotelId = isNaN(+params.hotelId) ? undefined : +params.hotelId
|
||||||
const methods = useForm<BookingWidgetSchema>({
|
const methods = useForm({
|
||||||
defaultValues: {
|
defaultValues: {
|
||||||
search: selectedLocation?.name ?? "",
|
search: selectedLocation?.name ?? "",
|
||||||
// Only used for displaying the selected location for mobile, not for actual form input
|
// Only used for displaying the selected location for mobile, not for actual form input
|
||||||
|
|||||||
@@ -18,8 +18,6 @@ import { getMultiroomDetailsSchema } from "./schema"
|
|||||||
|
|
||||||
import styles from "./details.module.css"
|
import styles from "./details.module.css"
|
||||||
|
|
||||||
import type { MultiroomDetailsSchema } from "@/types/components/hotelReservation/enterDetails/details"
|
|
||||||
|
|
||||||
const formID = "enter-details"
|
const formID = "enter-details"
|
||||||
export default function Details() {
|
export default function Details() {
|
||||||
const intl = useIntl()
|
const intl = useIntl()
|
||||||
@@ -53,7 +51,7 @@ export default function Details() {
|
|||||||
[idx, rooms]
|
[idx, rooms]
|
||||||
)
|
)
|
||||||
|
|
||||||
const methods = useForm<MultiroomDetailsSchema>({
|
const methods = useForm({
|
||||||
criteriaMode: "all",
|
criteriaMode: "all",
|
||||||
mode: "all",
|
mode: "all",
|
||||||
resolver: zodResolver(getMultiroomDetailsSchema(crossValidationData)),
|
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 memberRate = "member" in room.roomRate ? room.roomRate.member : null
|
||||||
|
|
||||||
const methods = useForm<DetailsSchema>({
|
const methods = useForm({
|
||||||
criteriaMode: "all",
|
criteriaMode: "all",
|
||||||
mode: "all",
|
mode: "all",
|
||||||
resolver: zodResolver(user ? signedInDetailsSchema : guestDetailsSchema),
|
resolver: zodResolver(user ? signedInDetailsSchema : guestDetailsSchema),
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ export default function AddAncillaryFlowModal({
|
|||||||
const hasInsufficientPoints =
|
const hasInsufficientPoints =
|
||||||
(user?.membership?.currentPoints ?? 0) < (selectedAncillary?.points ?? 0)
|
(user?.membership?.currentPoints ?? 0) < (selectedAncillary?.points ?? 0)
|
||||||
|
|
||||||
const formMethods = useForm<AncillaryFormData>({
|
const formMethods = useForm({
|
||||||
defaultValues: {
|
defaultValues: {
|
||||||
quantityWithPoints: null,
|
quantityWithPoints: null,
|
||||||
quantityWithCard:
|
quantityWithCard:
|
||||||
|
|||||||
@@ -34,7 +34,7 @@
|
|||||||
"@contentstack/live-preview-utils": "^3.0.0",
|
"@contentstack/live-preview-utils": "^3.0.0",
|
||||||
"@formatjs/intl": "^2.10.15",
|
"@formatjs/intl": "^2.10.15",
|
||||||
"@hookform/error-message": "^2.0.1",
|
"@hookform/error-message": "^2.0.1",
|
||||||
"@hookform/resolvers": "^3.3.4",
|
"@hookform/resolvers": "^5.0.1",
|
||||||
"@internationalized/date": "^3.6.0",
|
"@internationalized/date": "^3.6.0",
|
||||||
"@netlify/blobs": "^8.1.0",
|
"@netlify/blobs": "^8.1.0",
|
||||||
"@netlify/functions": "^3.0.0",
|
"@netlify/functions": "^3.0.0",
|
||||||
|
|||||||
21
yarn.lock
21
yarn.lock
@@ -2408,12 +2408,14 @@ __metadata:
|
|||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
"@hookform/resolvers@npm:^3.3.4":
|
"@hookform/resolvers@npm:^5.0.1":
|
||||||
version: 3.10.0
|
version: 5.0.1
|
||||||
resolution: "@hookform/resolvers@npm:3.10.0"
|
resolution: "@hookform/resolvers@npm:5.0.1"
|
||||||
|
dependencies:
|
||||||
|
"@standard-schema/utils": "npm:^0.3.0"
|
||||||
peerDependencies:
|
peerDependencies:
|
||||||
react-hook-form: ^7.0.0
|
react-hook-form: ^7.55.0
|
||||||
checksum: 10c0/7ee44533b4cdc28c4fa2a94894c735411e5a1f830f4a617c580533321a9b901df0cc8c1e2fad81ad8d55154ebc5cb844cf9c116a3148ffae2bc48758c33cbb8e
|
checksum: 10c0/8260de1cd1b8b53629ea67555f3f027fdeabf4cd6da7f20cb76e646d353d998e61cf3a338d6313c94a31f32c23447403df5e584e5c8dddbca766ed7776513f8b
|
||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
@@ -8200,7 +8202,7 @@ __metadata:
|
|||||||
"@formatjs/intl": "npm:^2.10.15"
|
"@formatjs/intl": "npm:^2.10.15"
|
||||||
"@formatjs/swc-plugin-experimental": "npm:0.4.0"
|
"@formatjs/swc-plugin-experimental": "npm:0.4.0"
|
||||||
"@hookform/error-message": "npm:^2.0.1"
|
"@hookform/error-message": "npm:^2.0.1"
|
||||||
"@hookform/resolvers": "npm:^3.3.4"
|
"@hookform/resolvers": "npm:^5.0.1"
|
||||||
"@internationalized/date": "npm:^3.6.0"
|
"@internationalized/date": "npm:^3.6.0"
|
||||||
"@lokalise/node-api": "npm:^14.0.0"
|
"@lokalise/node-api": "npm:^14.0.0"
|
||||||
"@netlify/blobs": "npm:^8.1.0"
|
"@netlify/blobs": "npm:^8.1.0"
|
||||||
@@ -8803,6 +8805,13 @@ __metadata:
|
|||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
|
"@standard-schema/utils@npm:^0.3.0":
|
||||||
|
version: 0.3.0
|
||||||
|
resolution: "@standard-schema/utils@npm:0.3.0"
|
||||||
|
checksum: 10c0/6eb74cd13e52d5fc74054df51e37d947ef53f3ab9e02c085665dcca3c38c60ece8d735cebbdf18fbb13c775fbcb9becb3f53109b0e092a63f0f7389ce0993fd0
|
||||||
|
languageName: node
|
||||||
|
linkType: hard
|
||||||
|
|
||||||
"@storybook/addon-actions@npm:8.6.3":
|
"@storybook/addon-actions@npm:8.6.3":
|
||||||
version: 8.6.3
|
version: 8.6.3
|
||||||
resolution: "@storybook/addon-actions@npm:8.6.3"
|
resolution: "@storybook/addon-actions@npm:8.6.3"
|
||||||
|
|||||||
Reference in New Issue
Block a user