MCPcopy Create free account
hub / github.com/adobe/react-spectrum / getRowId

Function getRowId

packages/react-aria/src/gridlist/utils.ts:31–38  ·  view source on GitHub ↗
(state: ListState<T>, key: Key)

Source from the content-addressed store, hash-verified

29>();
30
31export function getRowId<T>(state: ListState<T>, key: Key): string {
32 let {id} = listMap.get(state) ?? {};
33 if (!id) {
34 throw new Error('Unknown list');
35 }
36
37 return `${id}-${normalizeKey(key)}`;
38}
39
40export function normalizeKey(key: Key): string {
41 if (typeof key === 'string') {

Callers 2

useGridListItemFunction · 0.90

Calls 1

normalizeKeyFunction · 0.70

Tested by

no test coverage detected