Skip to content

Commit

Permalink
fix startTransition inside renderers when _callbacks is undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
sync committed May 15, 2024
1 parent ad4c39e commit 3280e04
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17912,6 +17912,10 @@ to return true:wantsResponderID| |
var transition = ReactCurrentBatchConfig$1.transition;

if (transition !== null) {
if (!transition._callbacks) {
transition._callbacks = new Set();
}

// Whenever a transition update is scheduled, register a callback on the
// transition object so we can get the return value of the scope function.
transition._callbacks.add(handleAsyncAction);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7629,7 +7629,12 @@ function requestUpdateLane(fiber) {
if (0 !== (executionContext & 2) && 0 !== workInProgressRootRenderLanes)
return workInProgressRootRenderLanes & -workInProgressRootRenderLanes;
fiber = ReactCurrentBatchConfig$1.transition;
null !== fiber && fiber._callbacks.add(handleAsyncAction);
if (null !== fiber) {
if (!fiber._callbacks) {
fiber._callbacks = new Set();
}
fiber._callbacks.add(handleAsyncAction);
}
if (null !== fiber)
return (
0 === currentEventTransitionLane &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8015,7 +8015,12 @@ function requestUpdateLane(fiber) {
if (0 !== (executionContext & 2) && 0 !== workInProgressRootRenderLanes)
return workInProgressRootRenderLanes & -workInProgressRootRenderLanes;
fiber = ReactCurrentBatchConfig$1.transition;
null !== fiber && fiber._callbacks.add(handleAsyncAction);
if (null !== fiber)
if (!fiber._callbacks) {
fiber._callbacks = new Set();
}
fiber._callbacks.add(handleAsyncAction);
}
if (null !== fiber)
return (
0 === currentEventTransitionLane &&
Expand Down

0 comments on commit 3280e04

Please sign in to comment.