MCPcopy
hub / github.com/react/react / cloneUpdateQueue

Function cloneUpdateQueue

packages/react-reconciler/src/ReactFiberClassUpdateQueue.js:191–208  ·  view source on GitHub ↗
(
  current: Fiber,
  workInProgress: Fiber,
)

Source from the content-addressed store, hash-verified

189}
190
191export function cloneUpdateQueue<State>(
192 current: Fiber,
193 workInProgress: Fiber,
194): void {
195 // Clone the update queue from current. Unless it's already a clone.
196 const queue: UpdateQueue<State> = (workInProgress.updateQueue: any);
197 const currentQueue: UpdateQueue<State> = (current.updateQueue: any);
198 if (queue === currentQueue) {
199 const clone: UpdateQueue<State> = {
200 baseState: currentQueue.baseState,
201 firstBaseUpdate: currentQueue.firstBaseUpdate,
202 lastBaseUpdate: currentQueue.lastBaseUpdate,
203 shared: currentQueue.shared,
204 callbacks: null,
205 };
206 workInProgress.updateQueue = clone;
207 }
208}
209
210export function createUpdate(lane: Lane): Update<mixed> {
211 const update: Update<mixed> = {

Callers 3

updateCacheComponentFunction · 0.90
updateHostRootFunction · 0.90
updateClassInstanceFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected