From 5c8fcfffaa21f8f2f599ff9bceda25a86b7609d0 Mon Sep 17 00:00:00 2001 From: Harshrj53 Date: Wed, 3 Dec 2025 22:48:25 +0530 Subject: [PATCH] Improve legacy context strict mode warning message --- .../react-reconciler/src/ReactStrictModeWarnings.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/react-reconciler/src/ReactStrictModeWarnings.js b/packages/react-reconciler/src/ReactStrictModeWarnings.js index 99a37206ed5..c153cc74d02 100644 --- a/packages/react-reconciler/src/ReactStrictModeWarnings.js +++ b/packages/react-reconciler/src/ReactStrictModeWarnings.js @@ -338,13 +338,13 @@ if (__DEV__) { runWithFiberInDEV(firstFiber, () => { console.error( - 'Legacy context API has been detected within a strict-mode tree.' + - '\n\nThe old API will be supported in all 16.x releases, but applications ' + - 'using it should migrate to the new version.' + - '\n\nPlease update the following components: %s' + - '\n\nLearn more about this warning here: https://react.dev/link/legacy-context', + 'Legacy context API detected inside a StrictMode tree.\n\n' + + 'Support for the legacy API will eventually be removed. ' + + 'Please migrate the following components to the modern context API:\n\n%s\n\n' + + 'More info: https://react.dev/link/legacy-context', sortedNames, ); + }); }, );