From e3e9b96945cead9966f936af8755ff3168315c9a Mon Sep 17 00:00:00 2001 From: Ricky Hanlon Date: Mon, 8 Apr 2024 22:00:33 -0400 Subject: [PATCH] Soften useFormState warning --- packages/react-dom/src/__tests__/ReactDOMFizzServer-test.js | 2 +- packages/react-dom/src/__tests__/ReactDOMForm-test.js | 2 +- packages/react-reconciler/src/ReactFiberHooks.js | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/react-dom/src/__tests__/ReactDOMFizzServer-test.js b/packages/react-dom/src/__tests__/ReactDOMFizzServer-test.js index 2949443871c65..737d78139a4db 100644 --- a/packages/react-dom/src/__tests__/ReactDOMFizzServer-test.js +++ b/packages/react-dom/src/__tests__/ReactDOMFizzServer-test.js @@ -104,7 +104,7 @@ describe('ReactDOMFizzServer', () => { console.error = (error, ...args) => { if ( typeof error !== 'string' || - error.indexOf('ReactDOM.useFormState has been deprecated') === -1 + error.indexOf('ReactDOM.useFormState has been renamed') === -1 ) { originalConsoleError(error, ...args); } diff --git a/packages/react-dom/src/__tests__/ReactDOMForm-test.js b/packages/react-dom/src/__tests__/ReactDOMForm-test.js index 2d7a34aa75cfd..ba721c215fc64 100644 --- a/packages/react-dom/src/__tests__/ReactDOMForm-test.js +++ b/packages/react-dom/src/__tests__/ReactDOMForm-test.js @@ -66,7 +66,7 @@ describe('ReactDOMForm', () => { console.error = (error, ...args) => { if ( typeof error !== 'string' || - error.indexOf('ReactDOM.useFormState has been deprecated') === -1 + error.indexOf('ReactDOM.useFormState has been renamed') === -1 ) { originalConsoleError(error, ...args); } diff --git a/packages/react-reconciler/src/ReactFiberHooks.js b/packages/react-reconciler/src/ReactFiberHooks.js index 127656768cf30..b2bd816fecb22 100644 --- a/packages/react-reconciler/src/ReactFiberHooks.js +++ b/packages/react-reconciler/src/ReactFiberHooks.js @@ -395,8 +395,8 @@ function warnOnUseFormStateInDev(): void { didWarnAboutUseFormState.add(componentName); console.error( - 'ReactDOM.useFormState has been deprecated and replaced by ' + - 'React.useActionState. Please update %s to use React.useActionState.', + 'ReactDOM.useFormState has been renamed to React.useActionState. ' + + 'Please update %s to use React.useActionState.', componentName, ); }