diff --git a/packages/docusaurus-theme-search-algolia/src/theme/SearchBar/index.tsx b/packages/docusaurus-theme-search-algolia/src/theme/SearchBar/index.tsx index 4072a70000..cf681939b1 100644 --- a/packages/docusaurus-theme-search-algolia/src/theme/SearchBar/index.tsx +++ b/packages/docusaurus-theme-search-algolia/src/theme/SearchBar/index.tsx @@ -67,10 +67,6 @@ interface DocSearchV4Props extends Omit { translations?: DocSearchTranslations; } -type SearchBarProps = Partial< - Pick ->; - let DocSearchModal: typeof DocSearchModalType | null = null; function importDocSearchModalIfNeeded() { @@ -316,12 +312,15 @@ function DocSearch({externalUrlRegex, ...props}: DocSearchV4Props) { ); } -export default function SearchBar(props: SearchBarProps): ReactNode { +export default function SearchBar(props: Partial): ReactNode { const {siteConfig} = useDocusaurusContext(); - return ( - - ); + + const docSearchProps: DocSearchV4Props = { + ...(siteConfig.themeConfig.algolia as DocSearchV4Props), + // Let props override theme config + // See https://github.com/facebook/docusaurus/pull/11581 + ...props, + }; + + return ; }