Skip to main content

Function: useFetchSearchNative()

useFetchSearchNative<T, P>(params, options, path): useSearchNativeResponse<T>

Defined in: packages/core/src/react/hooks/useFetchSearchNative.ts:37

The useFetchSearchNative hook. Returns a collection of search entities retrieved through the WP native search endpoint

See useSearchNative for usage instructions.

Type Parameters

T

T extends PostSearchEntity | TermSearchEntity = PostSearchEntity | TermSearchEntity

P

P extends SearchParams = SearchParams

Parameters

params

The list of params to pass to the fetch strategy. It overrides the ones in the URL.

{ } | P

options

FetchHookOptions<FetchResponse<T[]>> = {}

The options to pass to the swr hook.

path

string = ''

The path of the url to get url params from.

Returns

useSearchNativeResponse<T>