Skip to content
Closed
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions packages/docusaurus-theme-classic/src/theme-classic.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -900,7 +900,7 @@ declare module '@theme/Navbar/Search' {
readonly className?: string;
}

export default function NavbarSearch(props: Props): JSX.Element;
export default function NavbarSearch(props: Props): JSX.Element | null;
}

declare module '@theme/NavbarItem/DefaultNavbarItem' {
Expand Down Expand Up @@ -1117,7 +1117,7 @@ declare module '@theme/PaginatorNavLink' {
}

declare module '@theme/SearchBar' {
export default function SearchBar(): JSX.Element;
export default function SearchBar(): JSX.Element | null;
}

declare module '@theme/TabItem' {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ import styles from './styles.module.css';
export default function NavbarSearch({
children,
className,
}: Props): JSX.Element {
}: Props): JSX.Element | null {
if ((children as any)?.type?.() === null) {
return null;
}
return <div className={clsx(className, styles.searchBox)}>{children}</div>;
}