Skip to content

Commit

Permalink
fix: avoid rendering search bar if no content plugin is enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
jeangovil committed May 29, 2023
1 parent 8826ea6 commit 6573e73
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -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 />
}

Expand Down

0 comments on commit 6573e73

Please sign in to comment.