Skip to main content

useValueSelector()

useValueSelector(props: UseValueSelectorParams): { onChange: (v: string | string[]) => void; val: string | any[] | undefined; }

Defined in: packages/react-querybuilder/src/components/ValueSelector.tsx:48

Transforms a value into an array when appropriate and provides a memoized change handler.

Parameters​

ParameterType
propsUseValueSelectorParams

Returns​

onChange​

onChange: (v: string | string[]) => void

Memoized change handler for value selectors

Parameters​

ParameterType
vstring | string[]

Returns​

void

val​

val: string | any[] | undefined

The value as provided or, if appropriate, as an array


caution

API documentation is generated from the latest commit on the main branch. It may be somewhat inconsistent with official releases of React Query Builder.