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

Method buildChild

packages/react-stately/src/layout/ListLayout.ts:466–477  ·  view source on GitHub ↗
(node: Node<T>, x: number, y: number, parentKey: Key | null)

Source from the content-addressed store, hash-verified

464 }
465
466 protected buildChild(node: Node<T>, x: number, y: number, parentKey: Key | null): LayoutNode {
467 if (this.isValid(node, this.orientation === 'horizontal' ? x : y)) {
468 return this.layoutNodes.get(node.key)!;
469 }
470
471 let layoutNode = this.buildNode(node, x, y);
472
473 layoutNode.layoutInfo.parentKey = parentKey ?? null;
474 layoutNode.layoutInfo.allowOverflow = true;
475 this.layoutNodes.set(node.key, layoutNode);
476 return layoutNode;
477 }
478
479 protected buildNode(node: Node<T>, x: number, y: number): LayoutNode {
480 switch (node.type) {

Callers 6

buildCollectionMethod · 0.95
buildSectionMethod · 0.95
buildTableHeaderMethod · 0.45
buildHeaderRowMethod · 0.45
buildRowGroupMethod · 0.45
buildRowMethod · 0.45

Calls 3

isValidMethod · 0.95
buildNodeMethod · 0.95
setMethod · 0.45

Tested by

no test coverage detected