Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -312,9 +312,15 @@ function DocSearch({externalUrlRegex, ...props}: DocSearchV4Props) {
);
}

export default function SearchBar(): ReactNode {
export default function SearchBar(props: Partial<DocSearchV4Props>): ReactNode {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made the prop type more permissive so that we can override everything (at your own risk)

const {siteConfig} = useDocusaurusContext();
return (
<DocSearch {...(siteConfig.themeConfig.algolia as DocSearchV4Props)} />
);

const docSearchProps: DocSearchV4Props = {
...(siteConfig.themeConfig.algolia as DocSearchV4Props),
// Let props override theme config
// See https://github.com/facebook/docusaurus/pull/11581

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

useful comment to remember the purpose

...props,
};

return <DocSearch {...docSearchProps} />;
}
Loading