From a20f6378aaf3426b1cb1538942c4181caa31edec Mon Sep 17 00:00:00 2001 From: Shanmughapriyan S Date: Wed, 3 Aug 2022 14:25:51 +0530 Subject: [PATCH] refactor: remove unused state (#4848) --- beta/src/components/Search.tsx | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/beta/src/components/Search.tsx b/beta/src/components/Search.tsx index a71a9770..0cdd8a29 100644 --- a/beta/src/components/Search.tsx +++ b/beta/src/components/Search.tsx @@ -99,7 +99,6 @@ export const Search: React.FC = ({ hitsPerPage: 5, }, }) => { - const [isLoaded] = React.useState(true); const [isShowing, setIsShowing] = React.useState(false); const importDocSearchModalIfNeeded = React.useCallback( @@ -109,8 +108,8 @@ export const Search: React.FC = ({ } // @ts-ignore - return Promise.all([import('@docsearch/react/modal')]).then( - ([{DocSearchModal: Modal}]) => { + return import('@docsearch/react/modal').then( + ({DocSearchModal: Modal}) => { DocSearchModal = Modal; } ); @@ -165,8 +164,7 @@ export const Search: React.FC = ({ - {isLoaded && - isShowing && + {isShowing && createPortal(