Skip to main content

getOption()

Call Signature

getOption<OptType>(arr: FullOptionList<OptType>, name: string): undefined | OptType

Defined in: packages/react-querybuilder/src/utils/optGroupUtils.ts:266

Gets the option from an OptionList with the given name. Handles Option arrays as well as OptionGroup arrays.

Type Parameters

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

Parameters

ParameterType
arrFullOptionList<OptType>
namestring

Returns

undefined | OptType

Call Signature

getOption<OptType>(arr: FlexibleOptionList<OptType>, name: string): undefined | OptType

Defined in: packages/react-querybuilder/src/utils/optGroupUtils.ts:270

Gets the option from an OptionList with the given name. Handles Option arrays as well as OptionGroup arrays.

Type Parameters

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

Parameters

ParameterType
arrFlexibleOptionList<OptType>
namestring

Returns

undefined | OptType

Call Signature

getOption<OptType>(arr: FlexibleOptionList<OptType>, name: string): undefined | OptType

Defined in: packages/react-querybuilder/src/utils/optGroupUtils.ts:274

Gets the option from an OptionList with the given name. Handles Option arrays as well as OptionGroup arrays.

Type Parameters

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

Parameters

ParameterType
arrFlexibleOptionList<OptType>
namestring

Returns

undefined | OptType


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.