From cc427e967d63523b90ecc1c6aa2c864cb13b4b58 Mon Sep 17 00:00:00 2001 From: Shin'ya Ueoka Date: Thu, 5 May 2022 10:17:20 +0000 Subject: Pass source string via argument --- src/console/components/CommandPrompt.tsx | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'src/console/components') diff --git a/src/console/components/CommandPrompt.tsx b/src/console/components/CommandPrompt.tsx index 0312fe4..89acf57 100644 --- a/src/console/components/CommandPrompt.tsx +++ b/src/console/components/CommandPrompt.tsx @@ -22,7 +22,7 @@ const CommandPromptInner: React.FC = ({ initialInputValue }) => { const hide = useHide(); const [inputValue, setInputValue] = React.useState(initialInputValue); const debouncedValue = useDebounce(inputValue, 100); - const { completions, updateCompletions } = useCompletions(); + const { completions } = useCompletions(debouncedValue); const { select, currentValue, selectNext, selectPrev } = useSelectCompletion(); const execCommand = useExecCommand(); @@ -83,10 +83,6 @@ const CommandPromptInner: React.FC = ({ initialInputValue }) => { setInputValue(text); }; - React.useEffect(() => { - updateCompletions(debouncedValue); - }, [debouncedValue]); - return (