Skip to content

Commit

Permalink
update comment
Browse files Browse the repository at this point in the history
  • Loading branch information
NE-SmallTown committed Apr 28, 2020
1 parent f3db2f5 commit 7c8506a
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 2 deletions.
Expand Up @@ -318,7 +318,7 @@ describe('SimpleEventPlugin', function() {
Scheduler.unstable_flushAll();
expect(ops).toEqual([]);
});

// HEAVEN deterministic
it('end result of many interactive updates is deterministic', () => {
container = document.createElement('div');
const root = ReactDOM.unstable_createRoot(container);
Expand Down
1 change: 1 addition & 0 deletions packages/react-reconciler/src/ReactFiberCommitWork.js
Expand Up @@ -395,6 +395,7 @@ export function commitPassiveHookEffects(finishedWork: Fiber): void {
case FunctionComponent:
case ForwardRef:
case SimpleMemoComponent: {
// 先执行所有的 unmount,再执行所有的 mount
commitHookEffectList(UnmountPassive, NoHookEffect, finishedWork);
commitHookEffectList(NoHookEffect, MountPassive, finishedWork);
break;
Expand Down
2 changes: 1 addition & 1 deletion packages/react-reconciler/src/ReactUpdateQueue.js
Expand Up @@ -485,7 +485,7 @@ export function processUpdateQueue<State>(
// we have no way of detecting the difference between a committed and suspended
// update here.
markRenderEventTimeAndConfig(updateExpirationTime, update.suspenseConfig);

// HEAVEN setState 第一个参数如果是 func,那么什么时候去调?
// Process it and compute a new result.
resultState = getStateFromUpdate(
workInProgress,
Expand Down
Expand Up @@ -181,6 +181,7 @@ describe('ReactIncrementalUpdates', () => {
// Now flush the remaining work. Even though e and f were already processed,
// they should be processed again, to ensure that the terminal state
// is deterministic.
// HEAVEN deterministic
expect(Scheduler).toFlushAndYield([
'a',
'b',
Expand Down

0 comments on commit 7c8506a

Please sign in to comment.