We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
useFormState
StrictMode
1 parent c2f1a2c commit f792c17Copy full SHA for f792c17
packages/react-reconciler/src/ReactFiberHooks.js
@@ -2259,6 +2259,9 @@ function rerenderFormState<S, P>(
2259
);
2260
}
2261
2262
+ // For mount, pending is always false.
2263
+ const [isPending] = updateState(false);
2264
+
2265
// This is a mount. No updates to process.
2266
const state: Awaited<S> = stateHook.memoizedState;
2267
@@ -2269,8 +2272,7 @@ function rerenderFormState<S, P>(
2269
2272
// This may have changed during the rerender.
2270
2273
actionQueueHook.memoizedState = action;
2271
2274
- // For mount, pending is always false.
- return [state, dispatch, false];
2275
+ return [state, dispatch, isPending];
2276
2277
2278
function pushEffect(
0 commit comments