MCPcopy Create free account
hub / github.com/donghaxkim/react-rewrite / collectJSXTextNodes

Function collectJSXTextNodes

packages/cli/src/transform.ts:1564–1570  ·  view source on GitHub ↗
(node: any, result: any[])

Source from the content-addressed store, hash-verified

1562}
1563
1564function collectJSXTextNodes(node: any, result: any[]): void {
1565 if (!node.children) return;
1566 for (const child of node.children) {
1567 if (child.type === "JSXText") result.push(child);
1568 if (child.type === "JSXElement") collectJSXTextNodes(child, result);
1569 }
1570}
1571
1572/**
1573 * Replace text content of a JSX element at the given source position.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected