Soften useFormState warning (#28788)
It's not deprecated, it's really just renamed. Let's make the warning less scary.
Ricky committed
Apr 8, 2024 at 23:22 UTC
9644d206e8d92d0e31a9252d78933a48c62eb427
3 files changed
+4
-4
packages/react-dom/src/__tests__/ReactDOMFizzServer-test.js
+1
-1
@@ -104,7 +104,7 @@ describe('ReactDOMFizzServer', () => {
104
console.error = (error, ...args) => {
105
if (
106
typeof error !== 'string' ||
107
- error.indexOf('ReactDOM.useFormState has been deprecated') === -1
107
+ error.indexOf('ReactDOM.useFormState has been renamed') === -1
108
) {
109
originalConsoleError(error, ...args);
110
}
packages/react-dom/src/__tests__/ReactDOMForm-test.js
+1
-1
@@ -66,7 +66,7 @@ describe('ReactDOMForm', () => {
66
console.error = (error, ...args) => {
67
if (
68
typeof error !== 'string' ||
69
- error.indexOf('ReactDOM.useFormState has been deprecated') === -1
69
+ error.indexOf('ReactDOM.useFormState has been renamed') === -1
70
) {
71
originalConsoleError(error, ...args);
72
}
packages/react-reconciler/src/ReactFiberHooks.js
+2
-2
@@ -395,8 +395,8 @@ function warnOnUseFormStateInDev(): void {
395
didWarnAboutUseFormState.add(componentName);
396
397
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.',
400
componentName,
401
);
402
}