stargaze-studio/components/collections/queries/Combobox.hooks.ts
2022-07-26 11:42:45 +03:00

9 lines
262 B
TypeScript

import { useState } from 'react'
import type { QueryListItem } from './query'
export const useQueryComboboxState = () => {
const [value, setValue] = useState<QueryListItem | null>(null)
return { value, onChange: (item: QueryListItem) => setValue(item) }
}