MCPcopy Index your code
hub / github.com/JedWatson/react-select / toCategorizedOption

Function toCategorizedOption

packages/react-select/src/Select.tsx:372–396  ·  view source on GitHub ↗
(
  props: Props<Option, IsMulti, Group>,
  option: Option,
  selectValue: Options<Option>,
  index: number
)

Source from the content-addressed store, hash-verified

370 | CategorizedOption<Option>;
371
372function toCategorizedOption<
373 Option,
374 IsMulti extends boolean,
375 Group extends GroupBase<Option>
376>(
377 props: Props<Option, IsMulti, Group>,
378 option: Option,
379 selectValue: Options<Option>,
380 index: number
381): CategorizedOption<Option> {
382 const isDisabled = isOptionDisabled(props, option, selectValue);
383 const isSelected = isOptionSelected(props, option, selectValue);
384 const label = getOptionLabel(props, option);
385 const value = getOptionValue(props, option);
386
387 return {
388 type: 'option',
389 data: option,
390 isDisabled,
391 isSelected,
392 label,
393 value,
394 index,
395 };
396}
397
398function buildCategorizedOptions<
399 Option,

Callers 1

buildCategorizedOptionsFunction · 0.85

Calls 4

isOptionDisabledFunction · 0.90
getOptionLabelFunction · 0.90
getOptionValueFunction · 0.90
isOptionSelectedFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…