(fiber: FiberNode)
| 29 | export const appendChildToContainer = appendInitialChild; |
| 30 | |
| 31 | export 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 | |
| 46 | export function commitTextUpdate(textInstance: TextInstance, content: string) { |
| 47 | textInstance.textContent = content; |
no test coverage detected