Skip to main content

prepareOptionList()

prepareOptionList<O>(props: PrepareOptionListParams<O>): PreparedOptionList<O>

Defined in: packages/core/src/utils/optGroupUtils.ts:400

Normalizes any accepted option list shape—array, option groups, or a record—into a FullOptionList, applying baseOption properties and (when autoSelectOption is false) a leading placeholder option. Also returns the flattened lookup map and the option that should be selected by default.

Note: labelMap overrides only apply to array/option group input (where string options are expanded); record input derives labels from the record values themselves.

This is the same normalization <QueryBuilder /> applies to fields, operators, combinators, and value lists, so a non-React implementation resolves options identically.

Type Parameters

Type Parameter
O extends {[key: string]: unknown; disabled?: boolean; label: string; name: string; value: string; }

Parameters

ParameterType
propsPrepareOptionListParams<O>

Returns

PreparedOptionList<O>


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.