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

Method buildChild

packages/@react-spectrum/ai/src/ListLayout.ts:659–670  ·  view source on GitHub ↗
(node: Node<T>, x: number, y: number, parentKey: Key | null)

Source from the content-addressed store, hash-verified

657 }
658
659 protected buildChild(node: Node<T>, x: number, y: number, parentKey: Key | null): LayoutNode {
660 if (this.isValid(node, this.orientation === 'horizontal' ? x : y)) {
661 return this.layoutNodes.get(node.key)!;
662 }
663
664 let layoutNode = this.buildNode(node, x, y);
665
666 layoutNode.layoutInfo.parentKey = parentKey ?? null;
667 layoutNode.layoutInfo.allowOverflow = true;
668 this.layoutNodes.set(node.key, layoutNode);
669 return layoutNode;
670 }
671
672 protected buildNode(node: Node<T>, x: number, y: number): LayoutNode {
673 switch (node.type) {

Callers 2

buildCollectionMethod · 0.95
buildSectionMethod · 0.95

Calls 3

isValidMethod · 0.95
buildNodeMethod · 0.95
setMethod · 0.45

Tested by

no test coverage detected