Skip to content

Commit 93882bd

Browse files
authored
[errors] s/form state/action state (facebook#35790)
Noticed `useActionState` error still refers to "form state" while writing the docs.
1 parent 3bc2d41 commit 93882bd

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

packages/react-dom/src/__tests__/ReactDOMForm-test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1092,7 +1092,7 @@ describe('ReactDOMForm', () => {
10921092
const root = ReactDOMClient.createRoot(container);
10931093
await act(async () => {
10941094
root.render(<App />);
1095-
await waitForThrow('Cannot update form state while rendering.');
1095+
await waitForThrow('Cannot update action state while rendering.');
10961096
});
10971097
});
10981098

packages/react-reconciler/src/ReactFiberHooks.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2085,7 +2085,7 @@ function dispatchActionState<S, P>(
20852085
payload: P,
20862086
): void {
20872087
if (isRenderPhaseUpdate(fiber)) {
2088-
throw new Error('Cannot update form state while rendering.');
2088+
throw new Error('Cannot update action state while rendering.');
20892089
}
20902090

20912091
const currentAction = actionQueue.action;

scripts/error-codes/codes.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,7 @@
470470
"482": "An unknown Component is an async Client Component. Only Server Components can be async at the moment. This error is often caused by accidentally adding `'use client'` to a module that was originally written for the server.",
471471
"483": "Hooks are not supported inside an async component. This error is often caused by accidentally adding `'use client'` to a module that was originally written for the server.",
472472
"484": "A Server Component was postponed. The reason is omitted in production builds to avoid leaking sensitive details.",
473-
"485": "Cannot update form state while rendering.",
473+
"485": "Cannot update action state while rendering.",
474474
"486": "It should not be possible to postpone at the root. This is a bug in React.",
475475
"487": "We should not have any resumable nodes in the shell. This is a bug in React.",
476476
"488": "Couldn't find all resumable slots by key/index during replaying. The tree doesn't match so React will fallback to client rendering.",

0 commit comments

Comments
 (0)