MCPcopy Create free account
hub / github.com/NetEase/tango / replaceNode

Method replaceNode

packages/core/src/models/view-module.ts:365–368  ·  view source on GitHub ↗

* 替换目标节点为新节点 * @param targetNodeId * @param newNode

(targetNodeId: string, newNode: t.JSXElement)

Source from the content-addressed store, hash-verified

363 * @param newNode
364 */
365 replaceNode(targetNodeId: string, newNode: t.JSXElement) {
366 this.ast = replaceJSXElement(this.ast, targetNodeId, newNode);
367 return this;
368 }
369
370 /**
371 * 替换 jsx 跟结点的子元素

Callers

nothing calls this directly

Calls 1

replaceJSXElementFunction · 0.90

Tested by

no test coverage detected