Skip to content

Commit 9644d20

Browse files
authored
Soften useFormState warning (#28788)
It's not deprecated, it's really just renamed. Let's make the warning less scary.
1 parent c771016 commit 9644d20

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ describe('ReactDOMFizzServer', () => {
104104
console.error = (error, ...args) => {
105105
if (
106106
typeof error !== 'string' ||
107-
error.indexOf('ReactDOM.useFormState has been deprecated') === -1
107+
error.indexOf('ReactDOM.useFormState has been renamed') === -1
108108
) {
109109
originalConsoleError(error, ...args);
110110
}

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ describe('ReactDOMForm', () => {
6666
console.error = (error, ...args) => {
6767
if (
6868
typeof error !== 'string' ||
69-
error.indexOf('ReactDOM.useFormState has been deprecated') === -1
69+
error.indexOf('ReactDOM.useFormState has been renamed') === -1
7070
) {
7171
originalConsoleError(error, ...args);
7272
}

packages/react-reconciler/src/ReactFiberHooks.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -395,8 +395,8 @@ function warnOnUseFormStateInDev(): void {
395395
didWarnAboutUseFormState.add(componentName);
396396

397397
console.error(
398-
'ReactDOM.useFormState has been deprecated and replaced by ' +
399-
'React.useActionState. Please update %s to use React.useActionState.',
398+
'ReactDOM.useFormState has been renamed to React.useActionState. ' +
399+
'Please update %s to use React.useActionState.',
400400
componentName,
401401
);
402402
}

0 commit comments

Comments
 (0)