Skip to content

Instantly share code, notes, and snippets.

@pomber
Created October 14, 2017 17:59
Show Gist options
  • Save pomber/58c4b8fddd13f9ab2e59559526bdb091 to your computer and use it in GitHub Desktop.
Save pomber/58c4b8fddd13f9ab2e59559526bdb091 to your computer and use it in GitHub Desktop.
function completeWork(fiber) {
if (fiber.tag == CLASS_COMPONENT) {
fiber.stateNode.__fiber = fiber;
}
if (fiber.parent) {
const childEffects = fiber.effects || [];
const thisEffect = fiber.effectTag != null ? [fiber] : [];
const parentEffects = fiber.parent.effects || [];
fiber.parent.effects = parentEffects.concat(childEffects, thisEffect);
} else {
pendingCommit = fiber;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment