MCPcopy Index your code
hub / github.com/adobe/react-spectrum / getLastChild

Function getLastChild

packages/react-aria/src/table/useTableRow.ts:168–174  ·  view source on GitHub ↗
(collection: Collection<Node<unknown>>, node: Node<unknown>)

Source from the content-addressed store, hash-verified

166}
167
168function getLastChild(collection: Collection<Node<unknown>>, node: Node<unknown>) {
169 if ('lastChildKey' in node) {
170 return node.lastChildKey != null ? collection.getItem(node.lastChildKey) : null;
171 } else {
172 return Array.from(node.childNodes).findLast(item => item.parentKey === node.key);
173 }
174}

Callers 1

useTableRowFunction · 0.70

Calls 1

getItemMethod · 0.65

Tested by

no test coverage detected