Browse Source

refactor: remove unused state (#4848)

main
Shanmughapriyan S 2 years ago
committed by GitHub
parent
commit
a20f6378aa
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      beta/src/components/Search.tsx

8
beta/src/components/Search.tsx

@ -99,7 +99,6 @@ export const Search: React.FC<SearchProps> = ({
hitsPerPage: 5, hitsPerPage: 5,
}, },
}) => { }) => {
const [isLoaded] = React.useState(true);
const [isShowing, setIsShowing] = React.useState(false); const [isShowing, setIsShowing] = React.useState(false);
const importDocSearchModalIfNeeded = React.useCallback( const importDocSearchModalIfNeeded = React.useCallback(
@ -109,8 +108,8 @@ export const Search: React.FC<SearchProps> = ({
} }
// @ts-ignore // @ts-ignore
return Promise.all([import('@docsearch/react/modal')]).then( return import('@docsearch/react/modal').then(
([{DocSearchModal: Modal}]) => { ({DocSearchModal: Modal}) => {
DocSearchModal = Modal; DocSearchModal = Modal;
} }
); );
@ -165,8 +164,7 @@ export const Search: React.FC<SearchProps> = ({
</span> </span>
</button> </button>
{isLoaded && {isShowing &&
isShowing &&
createPortal( createPortal(
<DocSearchModal <DocSearchModal
{...options} {...options}

Loading…
Cancel
Save