import {useState} from 'react'import {useCombobox} from 'downshift'const items = ['apple','apricor','pear','orange','grape','banana'];export default function App() { const [inputItems, setInputItems] = useState(items); const {isOpen, getToggleButtonProps, getLabelProps, getMenuProps, getInputProps, getComboboxProps, highlightedIndex, getItemProps, } = useCombobox({ items: inputItems, onInputValueChange: ({ inputValue }) => { setInputItems(items.filter(item => item.toLowerCase().startsWith(inputValue.toLowerCase()),),)},}); return (
);}