MCPcopy
hub / github.com/adobe/react-spectrum / getItemId

Function getItemId

packages/react-aria/src/listbox/utils.ts:39–47  ·  view source on GitHub ↗
(state: ListState<T>, itemKey: Key)

Source from the content-addressed store, hash-verified

37}
38
39export function getItemId<T>(state: ListState<T>, itemKey: Key): string {
40 let data = listData.get(state);
41
42 if (!data) {
43 throw new Error('Unknown list');
44 }
45
46 return `${data.id}-option-${normalizeKey(itemKey)}`;
47}

Callers 2

useComboBoxFunction · 0.90
useOptionFunction · 0.90

Calls 1

normalizeKeyFunction · 0.70

Tested by

no test coverage detected