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

Function generateList

tests/OptionList.test.tsx:44–76  ·  view source on GitHub ↗
({ options, values, ref, ...props }: any)

Source from the content-addressed store, hash-verified

42 });
43
44 function generateList({ options, values, ref, ...props }: any) {
45 const fieldNames = fillFieldNames(props.fieldNames || {}, false);
46 const flattenedOptions = flattenOptions(options, {
47 fieldNames,
48 childrenAsData: false,
49 });
50
51 return (
52 <BaseSelectContext.Provider
53 value={{
54 prefixCls: 'rc-select',
55 ...props,
56 }}
57 >
58 <SelectContext.Provider
59 value={{
60 fieldNames,
61 flattenOptions: flattenedOptions,
62 options,
63 onActiveValue: () => {},
64 onSelect: () => {},
65 rawValues: values || new Set(),
66 virtual: true,
67 ...props,
68 }}
69 >
70 <div>
71 <OptionList ref={ref} />
72 </div>
73 </SelectContext.Provider>
74 </BaseSelectContext.Provider>
75 );
76 }
77
78 describe('renders correctly', () => {
79 const sharedConfig = {

Callers 1

Calls 2

fillFieldNamesFunction · 0.90
flattenOptionsFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…