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

Method visit

packages/react-aria-components/src/Table.tsx:221–238  ·  view source on GitHub ↗
(node: Node<T>)

Source from the content-addressed store, hash-verified

219 this.columns = [];
220 let columnKeyMap = new Map();
221 let visit = (node: Node<T>) => {
222 switch (node.type) {
223 case 'column':
224 columnKeyMap.set(node.key, node);
225 if (!node.hasChildNodes) {
226 node.index = this.columns.length;
227 this.columns.push(node);
228
229 if (node.props.isRowHeader) {
230 this.rowHeaderColumnKeys.add(node.key);
231 }
232 }
233 break;
234 }
235 for (let child of this.getChildren(node.key)) {
236 visit(child);
237 }
238 };
239
240 for (let node of this.getChildren(this.head.key)) {
241 visit(node);

Callers

nothing calls this directly

Calls 5

getChildrenMethod · 0.95
pushMethod · 0.80
addMethod · 0.65
visitFunction · 0.50
setMethod · 0.45

Tested by

no test coverage detected