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

Function visit

packages/react-stately/src/table/useTreeGridState.ts:174–193  ·  view source on GitHub ↗
(node: GridNode<T>)

Source from the content-addressed store, hash-verified

172
173 let topLevelRows: GridNode<T>[] = [];
174 let visit = (node: GridNode<T>) => {
175 switch (node.type) {
176 case 'body':
177 body = node;
178 keyMap.set(body.key, body);
179 break;
180 case 'column':
181 if (!node.hasChildNodes) {
182 userColumnCount++;
183 }
184 break;
185 case 'item':
186 topLevelRows.push(node);
187 return;
188 }
189
190 for (let child of node.childNodes) {
191 visit(child);
192 }
193 };
194
195 for (let node of nodes) {
196 if (node.type === 'column') {

Callers 15

visitMethod · 0.70
constructorMethod · 0.70
visitMethod · 0.50
constructorMethod · 0.50
visitMethod · 0.50
constructorMethod · 0.50
visitMethod · 0.50
constructorMethod · 0.50
visitMethod · 0.50
updateColumnsMethod · 0.50
transformFunction · 0.50

Calls 2

pushMethod · 0.80
setMethod · 0.45

Tested by

no test coverage detected