Repository navigation
create-fumadocs-app@16.2.17
Search hooks for each provider
fumadocs-core/search/client exports a hook for each search client, like useFetchSearch(). They return the props of <SearchDialog />:
const search = useFetchSearch({ locale });
<SearchDialog {...search} {...props}>
<SearchDialogList />
</SearchDialog>;data is the last successful search, its items have their content parsed into hastContent. error is set when the last search failed.
experimental_useSearch()creates a search hook from a memoized search function.useDocsSearch()is deprecated.useFlexsearchStatic()anduseOramaCloudLegacySearch()are exported from the paths of their clients.<SearchDialogList />showsdefaultItemswithout results.useSearchList()is removed,useSearch()returnsgetActive(),setActive()andsubscribeActive()for the active item.<SearchDialogListItem />renders adivinstead of abutton, table rows render their cells only.renderMarkdownof<SearchDialogListItem />renderscontentinstead ofhastContent. Without it, the string content of custom items is shown as text.- The templates of Fumadocs CLI and Create Fumadocs App use the new hooks.