Skip to main content

useValueSelector()

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

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

Parameters

ParameterType
propsUseValueSelectorParams

Returns

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

onChange()

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

Memoized change handler for value selectors

Parameters

ParameterType
vstring | string[]

Returns

void

val

val: undefined | string | any[]

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

Defined in

packages/react-querybuilder/src/components/ValueSelector.tsx:43


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.