Skip to content

Commit

Permalink
Soften useFormState warning (facebook#28788)
Browse files Browse the repository at this point in the history
It's not deprecated, it's really just renamed. Let's make the warning
less scary.
  • Loading branch information
rickhanlonii authored and AndyPengc12 committed Apr 15, 2024
1 parent 976650e commit a65dae3
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
2 changes: 1 addition & 1 deletion packages/react-dom/src/__tests__/ReactDOMForm-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
4 changes: 2 additions & 2 deletions packages/react-reconciler/src/ReactFiberHooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
);
}
Expand Down

0 comments on commit a65dae3

Please sign in to comment.