Skip to content

Commit

Permalink
Soften useFormState warning (#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 committed Apr 9, 2024
1 parent c771016 commit 9644d20
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 9644d20

Please sign in to comment.