( finishedWork: FiberNode, root: FiberRootNode )
| 191 | } |
| 192 | |
| 193 | const commitLayoutEffectsOnFiber = ( |
| 194 | finishedWork: FiberNode, |
| 195 | root: FiberRootNode |
| 196 | ) => { |
| 197 | const { flags, tag } = finishedWork; |
| 198 | |
| 199 | if ((flags & Ref) !== NoFlags && tag === HostComponent) { |
| 200 | // 绑定新的ref |
| 201 | safelyAttachRef(finishedWork); |
| 202 | finishedWork.flags &= ~Ref; |
| 203 | } |
| 204 | }; |
| 205 | |
| 206 | function safelyAttachRef(fiber: FiberNode) { |
| 207 | const ref = fiber.ref; |
nothing calls this directly
no test coverage detected