useStoreState
Receives an Ariakit store object (which can be null
or undefined
) and
returns the current state. If a key is provided as the second argument, it
returns the value of that key. If a selector function is provided, the state
is passed to it, and its return value is used.
The component using this hook will re-render when the returned value changes.
Code examples
Accessing the whole combobox state:
Accessing a specific value from the combobox state:
Accessing a value using a selector function:
Accessing the state of a store that may be null
or undefined
(for
example, using a context):