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

Function safelyAttachRef

packages/react-reconciler/src/commitWork.ts:206–216  ·  view source on GitHub ↗
(fiber: FiberNode)

Source from the content-addressed store, hash-verified

204};
205
206function safelyAttachRef(fiber: FiberNode) {
207 const ref = fiber.ref;
208 if (ref !== null) {
209 const instance = fiber.stateNode;
210 if (typeof ref === 'function') {
211 ref(instance);
212 } else {
213 ref.current = instance;
214 }
215 }
216}
217
218export const commitMutationEffects = commitEffects(
219 'mutation',

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected