Skip to content

Commit

Permalink
Refactored useMutableSource to use update queue
Browse files Browse the repository at this point in the history
For now, the hook just uses useEffect and useState under the hood. This probably makes it a little less effcient at runtime but perhaps a little smaller in code size.

This change ended up being a little larger than I would have assumed. Maybe that indicates there is room for improvement in my initial implementation.
  • Loading branch information
Brian Vaughn committed Feb 20, 2020
1 parent c8689d7 commit 7de01f1
Show file tree
Hide file tree
Showing 6 changed files with 3,346 additions and 3,307 deletions.
2 changes: 0 additions & 2 deletions packages/react-reconciler/src/ReactFiberCompleteWork.js
Expand Up @@ -28,7 +28,6 @@ import type {
import type {SuspenseContext} from './ReactFiberSuspenseContext';

import {now} from './SchedulerWithReactIntegration';
import {resetWorkInProgressVersions as resetMutableSourceWorkInProgressVersions} from './ReactMutableSource';

import {
IndeterminateComponent,
Expand Down Expand Up @@ -661,7 +660,6 @@ function completeWork(
return null;
}
case HostRoot: {
resetMutableSourceWorkInProgressVersions();
popHostContainer(workInProgress);
popTopLevelLegacyContextObject(workInProgress);
const fiberRoot = (workInProgress.stateNode: FiberRoot);
Expand Down

0 comments on commit 7de01f1

Please sign in to comment.