Skip to main content

SearchResultApi()

Home > @backstage/plugin-search-react > SearchResultApi

Request results through the search api and provide them to a child function.

Signature:

function SearchResultApi(props: SearchResultApiProps): JSX.Element | null

Parameters

ParameterTypeDescription
propsSearchResultApiPropssee SearchResultApiProps.

Returns:

JSX.Element | null

Example

<SearchResultApi>
{({ loading, error, value }) => (
<List>
{value?.map(({ document }) => (
<DefaultSearchResultListItem
key={document.location}
result={document}
/>
))}
</List>
)}
</SearchResultApi>