fix: SW-693 Fixed hydration error
This commit is contained in:
@@ -25,14 +25,15 @@ import type { Location } from "@/types/trpc/routers/hotel/locations"
|
||||
|
||||
const name = "search"
|
||||
export default function Search({ locations }: SearchProps) {
|
||||
const [state, dispatch] = useReducer(
|
||||
reducer,
|
||||
{ defaultLocations: locations },
|
||||
init
|
||||
)
|
||||
const { register, setValue, trigger } = useFormContext<BookingWidgetSchema>()
|
||||
const intl = useIntl()
|
||||
const value = useWatch({ name })
|
||||
const searchData = useWatch({ name: "location" })
|
||||
const [state, dispatch] = useReducer(
|
||||
reducer,
|
||||
{ defaultLocations: locations, searchData },
|
||||
init
|
||||
)
|
||||
|
||||
const handleMatchLocations = useCallback(
|
||||
function (searchValue: string) {
|
||||
|
||||
Reference in New Issue
Block a user