MCPcopy Create free account
hub / github.com/BetaSu/big-react / insertChildToContainer

Function insertChildToContainer

packages/react-noop-renderer/src/hostConfig.ts:101–115  ·  view source on GitHub ↗
(
	child: Instance,
	container: Container,
	before: Instance
)

Source from the content-addressed store, hash-verified

99}
100
101export function insertChildToContainer(
102 child: Instance,
103 container: Container,
104 before: Instance
105) {
106 const beforeIndex = container.children.indexOf(before);
107 if (beforeIndex === -1) {
108 throw new Error('before不存在');
109 }
110 const index = container.children.indexOf(child);
111 if (index !== -1) {
112 container.children.splice(index, 1);
113 }
114 container.children.splice(beforeIndex, 0, child);
115}
116
117export const scheduleMicroTask =
118 typeof queueMicrotask === 'function'

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected