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

Function commitUpdate

packages/react-dom/src/hostConfig.ts:31–44  ·  view source on GitHub ↗
(fiber: FiberNode)

Source from the content-addressed store, hash-verified

29export const appendChildToContainer = appendInitialChild;
30
31export function commitUpdate(fiber: FiberNode) {
32 switch (fiber.tag) {
33 case HostText:
34 const text = fiber.memoizedProps?.content;
35 return commitTextUpdate(fiber.stateNode, text);
36 case HostComponent:
37 return updateFiberProps(fiber.stateNode, fiber.memoizedProps);
38 default:
39 if (__DEV__) {
40 console.warn('未实现的Update类型', fiber);
41 }
42 break;
43 }
44}
45
46export function commitTextUpdate(textInstance: TextInstance, content: string) {
47 textInstance.textContent = content;

Callers 1

Calls 2

updateFiberPropsFunction · 0.90
commitTextUpdateFunction · 0.70

Tested by

no test coverage detected