Skip to content

Commit

Permalink
Reduce allocations in hot path by reusing the stash
Browse files Browse the repository at this point in the history
Since performUnitOfWork() is not reentrant, it should be safe to reuse the same stash every time instead of creating a new object.
  • Loading branch information
gaearon committed Apr 1, 2018
1 parent 5036a6c commit de91f01
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/react-reconciler/src/ReactFiberScheduler.js
Original file line number Diff line number Diff line change
Expand Up @@ -791,7 +791,7 @@ export default function<T, P, I, TI, HI, PI, C, CC, CX, PL>(

if (__DEV__ && replayFailedUnitOfWorkWithInvokeGuardedCallback) {
stashedWorkInProgressProperties = assignFiberPropertiesInDEV(
null,
stashedWorkInProgressProperties,
workInProgress,
);
}
Expand Down

0 comments on commit de91f01

Please sign in to comment.