mirror of
https://github.com/wavetermdev/docusaurus-og.git
synced 2026-08-05 13:46:35 -07:00
fix: avoid rendering search bar if no content plugin is enabled
This commit is contained in:
@@ -1,7 +1,11 @@
|
||||
import { useActivePlugin } from '@docusaurus/plugin-content-docs/lib/client/index.js'
|
||||
import React from 'react'
|
||||
import { SearchBar } from './SearchBar'
|
||||
|
||||
const SearchBarWrapper: React.FC = () => {
|
||||
const activePlugin = useActivePlugin()
|
||||
if (!activePlugin) return <></>
|
||||
|
||||
return typeof window === 'undefined' ? <></> : <SearchBar />
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user