Skip to content

Instantly share code, notes, and snippets.

@eabald
Created February 6, 2022 19:36
const initialGetSuggestions = useCallback(async () => {
if (props.value.inner.kind === 'value' && props.value.inner.value) {
const currentSuggestions = await getSuggestions(props.value.inner.value);
setSuggestions(currentSuggestions);
setTimeout(() => setVisible(false), 300);
}
}, []);
useEffect(() => {
initialGetSuggestions();
}, []);
useEffect(() => {
setVisible(!!suggestions.length);
}, [suggestions]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment