MCPcopy Create free account
hub / github.com/react-component/select / fillFieldNames

Function fillFieldNames

src/utils/valueUtil.ts:27–37  ·  view source on GitHub ↗
(fieldNames: FieldNames | undefined, childrenAsData: boolean)

Source from the content-addressed store, hash-verified

25}
26
27export function fillFieldNames(fieldNames: FieldNames | undefined, childrenAsData: boolean) {
28 const { label, value, options, groupLabel } = fieldNames || {};
29 const mergedLabel = label || (childrenAsData ? 'children' : 'label');
30
31 return {
32 label: mergedLabel,
33 value: value || 'value',
34 options: options || 'options',
35 groupLabel: groupLabel || mergedLabel,
36 };
37}
38
39/**
40 * Flat options into flatten list.

Callers 3

Select.tsxFile · 0.90
generateListFunction · 0.90
flattenOptionsFunction · 0.85

Calls

no outgoing calls

Tested by 1

generateListFunction · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…