Skip to content
Merged
Prev Previous commit
Next Next commit
Rename UpdateQueue effect type back to Callback
I don't love this name either, but it's less confusing than UpdateQueue
I suppose. Conceptually, this is usually a callback: setState callbacks,
componentDidCatch. The only case that feels a bit weird is Timeouts,
which use this effect to attach a promise listener. I guess that kinda
fits, too.
  • Loading branch information
acdlite committed Apr 21, 2018
commit 712816d79cb48bda69f5ba0f3112b57a68dbf607
4 changes: 2 additions & 2 deletions packages/react-reconciler/src/ReactFiberScheduler.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import {
PlacementAndUpdate,
Deletion,
ContentReset,
UpdateQueue as UpdateQueueEffect,
Callback,
ShouldCapture,
Ref,
Incomplete,
Expand Down Expand Up @@ -434,7 +434,7 @@ export default function<T, P, I, TI, HI, PI, C, CC, CX, PL>(
while (nextEffect !== null) {
const effectTag = nextEffect.effectTag;

if (effectTag & (Update | UpdateQueueEffect)) {
if (effectTag & (Update | Callback)) {
recordEffect();
const current = nextEffect.alternate;
commitLifeCycles(
Expand Down
8 changes: 4 additions & 4 deletions packages/react-reconciler/src/ReactUpdateQueue.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ import type {Fiber} from './ReactFiber';
import type {ExpirationTime} from './ReactFiberExpirationTime';

import {NoWork} from './ReactFiberExpirationTime';
import {UpdateQueue as UpdateQueueEffect} from 'shared/ReactTypeOfSideEffect';
import {Callback} from 'shared/ReactTypeOfSideEffect';
import {ClassComponent} from 'shared/ReactTypeOfWork';

import warning from 'fbjs/lib/warning';
Expand Down Expand Up @@ -422,7 +422,7 @@ function processSingleUpdate<State>(
const commit = update.commit;
const process = update.process;
if (commit !== null) {
workInProgress.effectTag |= UpdateQueueEffect;
workInProgress.effectTag |= Callback;
addToEffectList(queue, update);
}
if (process !== null) {
Expand Down Expand Up @@ -590,12 +590,12 @@ export function processUpdateQueue<State>(
if (newFirstRenderPhaseUpdate === null) {
queue.lastRenderPhaseUpdate = null;
} else {
workInProgress.effectTag |= UpdateQueueEffect;
workInProgress.effectTag |= Callback;
}
if (newFirstCapturedUpdate === null) {
queue.lastCapturedUpdate = null;
} else {
workInProgress.effectTag |= UpdateQueueEffect;
workInProgress.effectTag |= Callback;
}
if (
newFirstUpdate === null &&
Expand Down
2 changes: 1 addition & 1 deletion packages/shared/ReactTypeOfSideEffect.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const Update = /* */ 0b00000000100;
export const PlacementAndUpdate = /* */ 0b00000000110;
export const Deletion = /* */ 0b00000001000;
export const ContentReset = /* */ 0b00000010000;
export const UpdateQueue = /* */ 0b00000100000;
export const Callback = /* */ 0b00000100000;
export const DidCapture = /* */ 0b00001000000;
export const Ref = /* */ 0b00010000000;
export const Snapshot = /* */ 0b00100000000;
Expand Down