stargaze-studio/components/collections/queries/Combobox.hooks.ts

9 lines
262 B
TypeScript
Raw Normal View History

2022-07-26 08:42:45 +00:00
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) }
}