From 3e9db65fc3341148a5248b3ffc6bc68c0640fd3f Mon Sep 17 00:00:00 2001 From: Christoph Nakazawa Date: Fri, 23 May 2025 05:18:23 +0900 Subject: [PATCH] Fix typo in error message. (#33313) ## Summary I am writing code that isn't so good, so I saw this error message many times. It appears to have a typo. This PR fixes the typo. ## How did you test this change? Ran the tests --- .../src/__tests__/ReactCompositeComponentState-test.js | 2 +- .../__tests__/ReactDOMServerPartialHydration-test.internal.js | 2 +- .../ReactDOMServerPartialHydrationActivity-test.internal.js | 2 +- packages/react-reconciler/src/ReactFiberWorkLoop.js | 2 +- packages/react-reconciler/src/__tests__/Activity-test.js | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/react-dom/src/__tests__/ReactCompositeComponentState-test.js b/packages/react-dom/src/__tests__/ReactCompositeComponentState-test.js index d0d1c36e51..adfd4d5b4f 100644 --- a/packages/react-dom/src/__tests__/ReactCompositeComponentState-test.js +++ b/packages/react-dom/src/__tests__/ReactCompositeComponentState-test.js @@ -573,7 +573,7 @@ describe('ReactCompositeComponent-state', () => { assertConsoleErrorDev([ "Can't perform a React state update on a component that hasn't mounted yet. " + 'This indicates that you have a side-effect in your render function that ' + - 'asynchronously later calls tries to update the component. ' + + 'asynchronously tries to update the component. ' + 'Move this work to useEffect instead.\n' + ' in B (at **)', ]); diff --git a/packages/react-dom/src/__tests__/ReactDOMServerPartialHydration-test.internal.js b/packages/react-dom/src/__tests__/ReactDOMServerPartialHydration-test.internal.js index b3da527d30..8cace332cd 100644 --- a/packages/react-dom/src/__tests__/ReactDOMServerPartialHydration-test.internal.js +++ b/packages/react-dom/src/__tests__/ReactDOMServerPartialHydration-test.internal.js @@ -1922,7 +1922,7 @@ describe('ReactDOMServerPartialHydration', () => { assertConsoleErrorDev([ "Can't perform a React state update on a component that hasn't mounted yet. " + 'This indicates that you have a side-effect in your render function that ' + - 'asynchronously later calls tries to update the component. Move this work to useEffect instead.\n' + + 'asynchronously tries to update the component. Move this work to useEffect instead.\n' + ' in App (at **)', ]); diff --git a/packages/react-dom/src/__tests__/ReactDOMServerPartialHydrationActivity-test.internal.js b/packages/react-dom/src/__tests__/ReactDOMServerPartialHydrationActivity-test.internal.js index 1c82bb660d..c21c646946 100644 --- a/packages/react-dom/src/__tests__/ReactDOMServerPartialHydrationActivity-test.internal.js +++ b/packages/react-dom/src/__tests__/ReactDOMServerPartialHydrationActivity-test.internal.js @@ -1883,7 +1883,7 @@ describe('ReactDOMServerPartialHydrationActivity', () => { assertConsoleErrorDev([ "Can't perform a React state update on a component that hasn't mounted yet. " + 'This indicates that you have a side-effect in your render function that ' + - 'asynchronously later calls tries to update the component. Move this work to useEffect instead.\n' + + 'asynchronously tries to update the component. Move this work to useEffect instead.\n' + ' in App (at **)', ]); diff --git a/packages/react-reconciler/src/ReactFiberWorkLoop.js b/packages/react-reconciler/src/ReactFiberWorkLoop.js index cd5c1c1468..ecf22aaad0 100644 --- a/packages/react-reconciler/src/ReactFiberWorkLoop.js +++ b/packages/react-reconciler/src/ReactFiberWorkLoop.js @@ -4802,7 +4802,7 @@ export function warnAboutUpdateOnNotYetMountedFiberInDEV(fiber: Fiber) { console.error( "Can't perform a React state update on a component that hasn't mounted yet. " + 'This indicates that you have a side-effect in your render function that ' + - 'asynchronously later calls tries to update the component. Move this work to ' + + 'asynchronously tries to update the component. Move this work to ' + 'useEffect instead.', ); }); diff --git a/packages/react-reconciler/src/__tests__/Activity-test.js b/packages/react-reconciler/src/__tests__/Activity-test.js index d514bb4e0b..86db58a098 100644 --- a/packages/react-reconciler/src/__tests__/Activity-test.js +++ b/packages/react-reconciler/src/__tests__/Activity-test.js @@ -764,7 +764,7 @@ describe('Activity', () => { assertConsoleErrorDev([ "Can't perform a React state update on a component that hasn't mounted yet. " + 'This indicates that you have a side-effect in your render function that ' + - 'asynchronously later calls tries to update the component. ' + + 'asynchronously tries to update the component. ' + 'Move this work to useEffect instead.\n' + ' in Child (at **)', ]);