Skip to content
This repository has been archived by the owner on Jun 11, 2021. It is now read-only.

Commit

Permalink
feat(docsearch): use preconnect link in Docusaurus integration
Browse files Browse the repository at this point in the history
  • Loading branch information
francoischalifour committed Apr 10, 2020
1 parent 3a4f13b commit 33e2e8b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/website/src/theme/SearchBar/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { createPortal } from 'react-dom';
import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
import { useHistory } from '@docusaurus/router';
import Link from '@docusaurus/Link';
import Head from '@docusaurus/Head';
import { SearchButton } from 'docsearch-react';

let DocSearch = null;
Expand Down Expand Up @@ -85,6 +86,10 @@ function SearchBar() {

return (
<>
<Head>
<link rel="preconnect" href={`${appId}-dsn.algolia.net`} />
</Head>

<SearchButton onClick={onOpen} />

{isLoaded &&
Expand Down

0 comments on commit 33e2e8b

Please sign in to comment.