Skip to content

Commit ab33152

Browse files
committed
Bugfix: useFormState queues actions in wrong order (#27570)
I neglected to update the "last" pointer of the action queue. Since the queue is circular, rather than dropping the update, the effect was to add the update to the front of the queue instead of the back. I didn't notice earlier because in my demos/tests, the actions would either resolve really quickly or the actions weren't order dependent (like incrementing a counter). DiffTrain build for [b8e47d9](b8e47d9)
1 parent 83b9e01 commit ab33152

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

compiled/facebook-www/REVISION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
05fbd1aab036ecbd14469d6376024439bc931f68
1+
b8e47d988eb3ba547c102c0b12c351250ed955e0

compiled/facebook-www/React-prod.classic.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -587,4 +587,4 @@ exports.useSyncExternalStore = function (
587587
exports.useTransition = function () {
588588
return ReactCurrentDispatcher.current.useTransition();
589589
};
590-
exports.version = "18.3.0-www-classic-252d6948";
590+
exports.version = "18.3.0-www-classic-5fd0277f";

compiled/facebook-www/ReactTestRenderer-dev.classic.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8330,7 +8330,7 @@ function dispatchFormState(fiber, actionQueue, setState, payload) {
83308330
payload: payload,
83318331
next: first
83328332
};
8333-
last.next = _newLast;
8333+
actionQueue.pending = last.next = _newLast;
83348334
}
83358335
}
83368336

@@ -25267,7 +25267,7 @@ function createFiberRoot(
2526725267
return root;
2526825268
}
2526925269

25270-
var ReactVersion = "18.3.0-www-classic-252d6948";
25270+
var ReactVersion = "18.3.0-www-classic-5fd0277f";
2527125271

2527225272
// Might add PROFILE later.
2527325273

compiled/facebook-www/ReactTestRenderer-dev.modern.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8330,7 +8330,7 @@ function dispatchFormState(fiber, actionQueue, setState, payload) {
83308330
payload: payload,
83318331
next: first
83328332
};
8333-
last.next = _newLast;
8333+
actionQueue.pending = last.next = _newLast;
83348334
}
83358335
}
83368336

@@ -25267,7 +25267,7 @@ function createFiberRoot(
2526725267
return root;
2526825268
}
2526925269

25270-
var ReactVersion = "18.3.0-www-modern-cc07473f";
25270+
var ReactVersion = "18.3.0-www-modern-c5313fe8";
2527125271

2527225272
// Might add PROFILE later.
2527325273

0 commit comments

Comments
 (0)