Websites v4 docs v5.2.5
    Preparing search index...

    Interface UseSearchFormResult

    interface UseSearchFormResult {
        addTag: (tag: string) => void;
        distanceOptions: DistanceOption[];
        initialSearch: Search;
        maxBedroomOptions: BedroomOption[];
        maxPriceOptions: PriceOption[];
        minBedroomOptions: BedroomOption[];
        minPriceOptions: PriceOption[];
        removeTag: (tag: string) => void;
        removeTags: (tags: string[]) => void;
        search: Search;
        searchFormConfig: SectionElement | SearchForm | undefined;
        searching: boolean;
        setActiveSearchType: (searchType: string) => void;
        setChannel: (channel: string) => void;
        setDistance: (value: string | number | null) => void;
        setGeolocation: () => void;
        setMaxBedrooms: (value: string | number | null) => void;
        setMaxPrice: (value: string | number | null) => void;
        setMinBedrooms: (value: string | number | null) => void;
        setMinPrice: (value: string | number | null) => void;
        setPropertyType: (propertyType: string) => void;
        setSearchField: (
            payload: { [key: string]: string | number | null | undefined },
        ) => void;
        setStatus: (value: string | null) => void;
        setTags: (tags: string[]) => void;
        submitSearch: (e?: SyntheticEvent<Element, Event>, s?: Search) => void;
    }
    Index

    Properties

    addTag: (tag: string) => void
    distanceOptions: DistanceOption[]
    initialSearch: Search
    maxBedroomOptions: BedroomOption[]
    maxPriceOptions: PriceOption[]
    minBedroomOptions: BedroomOption[]
    minPriceOptions: PriceOption[]
    removeTag: (tag: string) => void
    removeTags: (tags: string[]) => void
    search: Search

    The full local search state for the form

    searchFormConfig: SectionElement | SearchForm | undefined
    searching: boolean

    Boolean value to represent whether a search is running. Useful for rendering a loading state like a spinner.

    setActiveSearchType: (searchType: string) => void
    setChannel: (channel: string) => void
    setDistance: (value: string | number | null) => void
    setGeolocation: () => void
    setMaxBedrooms: (value: string | number | null) => void
    setMaxPrice: (value: string | number | null) => void
    setMinBedrooms: (value: string | number | null) => void
    setMinPrice: (value: string | number | null) => void
    setPropertyType: (propertyType: string) => void
    setSearchField: (
        payload: { [key: string]: string | number | null | undefined },
    ) => void

    Function to set individual search field values directly. This must be passed to the LocationInput as a prop.

    setStatus: (value: string | null) => void
    setTags: (tags: string[]) => void
    submitSearch: (e?: SyntheticEvent<Element, Event>, s?: Search) => void

    Submit callback that should be added to the onSubmit handler of the search form