Update error messages (#28652)

## Overview

The error messages that say:

> ReactDOM.hydrate is no longer supported in React 18

Don't make sense in the React 19 release. Instead, they should say:

> ReactDOM.hydrate was removed in React 19.

For legacy mode, they should say:

> ReactDOM.hydrate has not been supported since React 18.

DiffTrain build for [dbfbfb3312](https://github.com/facebook/react/commit/dbfbfb3312db019183ef92fd2ef110cc7d807e80)
This commit is contained in:
rickhanlonii
2024-03-26 21:30:55 +00:00
parent 17f0c67368
commit eb7de0442f
14 changed files with 49 additions and 49 deletions
@@ -937,7 +937,7 @@ if (__DEV__) {
didWarnAboutElementRef[componentName] = true;
error(
"Accessing element.ref is no longer supported. ref is now a " +
"Accessing element.ref was removed in React 19. ref is now a " +
"regular prop. It will be removed from the JSX Element " +
"type in a future release."
);
@@ -937,7 +937,7 @@ if (__DEV__) {
didWarnAboutElementRef[componentName] = true;
error(
"Accessing element.ref is no longer supported. ref is now a " +
"Accessing element.ref was removed in React 19. ref is now a " +
"regular prop. It will be removed from the JSX Element " +
"type in a future release."
);
+1 -1
View File
@@ -1 +1 @@
f24cf4a1af4e677dd85fce66001eee42b75b1cf7
dbfbfb3312db019183ef92fd2ef110cc7d807e80
+2 -2
View File
@@ -24,7 +24,7 @@ if (__DEV__) {
) {
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
}
var ReactVersion = "19.0.0-www-classic-e98b6ae2";
var ReactVersion = "19.0.0-www-classic-5d26d7ce";
// ATTENTION
// When adding new symbols to this file,
@@ -1307,7 +1307,7 @@ if (__DEV__) {
didWarnAboutElementRef[componentName] = true;
error(
"Accessing element.ref is no longer supported. ref is now a " +
"Accessing element.ref was removed in React 19. ref is now a " +
"regular prop. It will be removed from the JSX Element " +
"type in a future release."
);
+2 -2
View File
@@ -24,7 +24,7 @@ if (__DEV__) {
) {
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
}
var ReactVersion = "19.0.0-www-modern-655002dc";
var ReactVersion = "19.0.0-www-modern-d20fe227";
// ATTENTION
// When adding new symbols to this file,
@@ -1307,7 +1307,7 @@ if (__DEV__) {
didWarnAboutElementRef[componentName] = true;
error(
"Accessing element.ref is no longer supported. ref is now a " +
"Accessing element.ref was removed in React 19. ref is now a " +
"regular prop. It will be removed from the JSX Element " +
"type in a future release."
);
+4 -4
View File
@@ -66,7 +66,7 @@ if (__DEV__) {
return self;
}
var ReactVersion = "19.0.0-www-modern-10ce85c5";
var ReactVersion = "19.0.0-www-modern-2edfe4d7";
var LegacyRoot = 0;
var ConcurrentRoot = 1;
@@ -12791,7 +12791,7 @@ if (__DEV__) {
{
if (ctor.childContextTypes) {
error(
"%s uses the legacy childContextTypes API which is no longer supported. " +
"%s uses the legacy childContextTypes API which was removed in React 19. " +
"Use React.createContext() instead.",
name
);
@@ -12799,7 +12799,7 @@ if (__DEV__) {
if (ctor.contextTypes) {
error(
"%s uses the legacy contextTypes API which is no longer supported. " +
"%s uses the legacy contextTypes API which was removed in React 19. " +
"Use React.createContext() with static contextType instead.",
name
);
@@ -15818,7 +15818,7 @@ if (__DEV__) {
{
if (Component.contextTypes) {
error(
"%s uses the legacy contextTypes API which is no longer supported. " +
"%s uses the legacy contextTypes API which was removed in React 19. " +
"Use React.createContext() with React.useContext() instead.",
getComponentNameFromType(Component) || "Unknown"
);
@@ -35845,7 +35845,7 @@ if (__DEV__) {
return root;
}
var ReactVersion = "19.0.0-www-classic-cec25015";
var ReactVersion = "19.0.0-www-classic-7b93bfeb";
function createPortal$1(
children,
@@ -48494,7 +48494,7 @@ if (__DEV__) {
function hydrate(element, container, callback) {
{
error(
"ReactDOM.hydrate is no longer supported in React 18. Use hydrateRoot " +
"ReactDOM.hydrate has not been supported since React 18. Use hydrateRoot " +
"instead. Until you switch to the new API, your app will behave as " +
"if it's running React 17. Learn " +
"more: https://react.dev/link/switch-to-createroot"
@@ -48530,7 +48530,7 @@ if (__DEV__) {
function render(element, container, callback) {
{
error(
"ReactDOM.render is no longer supported in React 18. Use createRoot " +
"ReactDOM.render has not been supported since React 18. Use createRoot " +
"instead. Until you switch to the new API, your app will behave as " +
"if it's running React 17. Learn " +
"more: https://react.dev/link/switch-to-createroot"
@@ -48571,8 +48571,8 @@ if (__DEV__) {
) {
{
error(
"ReactDOM.unstable_renderSubtreeIntoContainer() is no longer supported " +
"in React 18. Consider using a portal instead. Until you switch to " +
"ReactDOM.unstable_renderSubtreeIntoContainer() has not been supported " +
"since React 18. Consider using a portal instead. Until you switch to " +
"the createRoot API, your app will behave as if it's running React " +
"17. Learn more: https://react.dev/link/switch-to-createroot"
);
+4 -4
View File
@@ -17922,7 +17922,7 @@ if (__DEV__) {
{
if (ctor.childContextTypes) {
error(
"%s uses the legacy childContextTypes API which is no longer supported. " +
"%s uses the legacy childContextTypes API which was removed in React 19. " +
"Use React.createContext() instead.",
name
);
@@ -17930,7 +17930,7 @@ if (__DEV__) {
if (ctor.contextTypes) {
error(
"%s uses the legacy contextTypes API which is no longer supported. " +
"%s uses the legacy contextTypes API which was removed in React 19. " +
"Use React.createContext() with static contextType instead.",
name
);
@@ -21158,7 +21158,7 @@ if (__DEV__) {
{
if (Component.contextTypes) {
error(
"%s uses the legacy contextTypes API which is no longer supported. " +
"%s uses the legacy contextTypes API which was removed in React 19. " +
"Use React.createContext() with React.useContext() instead.",
getComponentNameFromType(Component) || "Unknown"
);
@@ -35692,7 +35692,7 @@ if (__DEV__) {
return root;
}
var ReactVersion = "19.0.0-www-modern-b40caa87";
var ReactVersion = "19.0.0-www-modern-6d2d5280";
function createPortal$1(
children,
@@ -19,7 +19,7 @@ if (__DEV__) {
var React = require("react");
var ReactDOM = require("react-dom");
var ReactVersion = "19.0.0-www-modern-46a9d3dd";
var ReactVersion = "19.0.0-www-modern-139d7d17";
// This refers to a WWW module.
var warningWWW = require("warning");
@@ -9305,7 +9305,7 @@ if (__DEV__) {
{
if (ctor.childContextTypes) {
error(
"%s uses the legacy childContextTypes API which is no longer supported. " +
"%s uses the legacy childContextTypes API which was removed in React 19. " +
"Use React.createContext() instead.",
name
);
@@ -9313,7 +9313,7 @@ if (__DEV__) {
if (ctor.contextTypes) {
error(
"%s uses the legacy contextTypes API which is no longer supported. " +
"%s uses the legacy contextTypes API which was removed in React 19. " +
"Use React.createContext() with static contextType instead.",
name
);
@@ -11979,7 +11979,7 @@ if (__DEV__) {
{
if (Component.contextTypes) {
error(
"%s uses the legacy contextTypes API which is no longer supported. " +
"%s uses the legacy contextTypes API which was removed in React 19. " +
"Use React.createContext() with React.useContext() instead.",
getComponentNameFromType(Component) || "Unknown"
);
@@ -9189,7 +9189,7 @@ if (__DEV__) {
{
if (ctor.childContextTypes) {
error(
"%s uses the legacy childContextTypes API which is no longer supported. " +
"%s uses the legacy childContextTypes API which was removed in React 19. " +
"Use React.createContext() instead.",
name
);
@@ -9197,7 +9197,7 @@ if (__DEV__) {
if (ctor.contextTypes) {
error(
"%s uses the legacy contextTypes API which is no longer supported. " +
"%s uses the legacy contextTypes API which was removed in React 19. " +
"Use React.createContext() with static contextType instead.",
name
);
@@ -11860,7 +11860,7 @@ if (__DEV__) {
{
if (Component.contextTypes) {
error(
"%s uses the legacy contextTypes API which is no longer supported. " +
"%s uses the legacy contextTypes API which was removed in React 19. " +
"Use React.createContext() with React.useContext() instead.",
getComponentNameFromType(Component) || "Unknown"
);
@@ -36469,7 +36469,7 @@ if (__DEV__) {
return root;
}
var ReactVersion = "19.0.0-www-classic-77ffc35e";
var ReactVersion = "19.0.0-www-classic-7628a4df";
function createPortal$1(
children,
@@ -49250,7 +49250,7 @@ if (__DEV__) {
function hydrate(element, container, callback) {
{
error(
"ReactDOM.hydrate is no longer supported in React 18. Use hydrateRoot " +
"ReactDOM.hydrate has not been supported since React 18. Use hydrateRoot " +
"instead. Until you switch to the new API, your app will behave as " +
"if it's running React 17. Learn " +
"more: https://react.dev/link/switch-to-createroot"
@@ -49286,7 +49286,7 @@ if (__DEV__) {
function render(element, container, callback) {
{
error(
"ReactDOM.render is no longer supported in React 18. Use createRoot " +
"ReactDOM.render has not been supported since React 18. Use createRoot " +
"instead. Until you switch to the new API, your app will behave as " +
"if it's running React 17. Learn " +
"more: https://react.dev/link/switch-to-createroot"
@@ -49327,8 +49327,8 @@ if (__DEV__) {
) {
{
error(
"ReactDOM.unstable_renderSubtreeIntoContainer() is no longer supported " +
"in React 18. Consider using a portal instead. Until you switch to " +
"ReactDOM.unstable_renderSubtreeIntoContainer() has not been supported " +
"since React 18. Consider using a portal instead. Until you switch to " +
"the createRoot API, your app will behave as if it's running React " +
"17. Learn more: https://react.dev/link/switch-to-createroot"
);
@@ -18059,7 +18059,7 @@ if (__DEV__) {
{
if (ctor.childContextTypes) {
error(
"%s uses the legacy childContextTypes API which is no longer supported. " +
"%s uses the legacy childContextTypes API which was removed in React 19. " +
"Use React.createContext() instead.",
name
);
@@ -18067,7 +18067,7 @@ if (__DEV__) {
if (ctor.contextTypes) {
error(
"%s uses the legacy contextTypes API which is no longer supported. " +
"%s uses the legacy contextTypes API which was removed in React 19. " +
"Use React.createContext() with static contextType instead.",
name
);
@@ -21295,7 +21295,7 @@ if (__DEV__) {
{
if (Component.contextTypes) {
error(
"%s uses the legacy contextTypes API which is no longer supported. " +
"%s uses the legacy contextTypes API which was removed in React 19. " +
"Use React.createContext() with React.useContext() instead.",
getComponentNameFromType(Component) || "Unknown"
);
@@ -36316,7 +36316,7 @@ if (__DEV__) {
return root;
}
var ReactVersion = "19.0.0-www-modern-fa53bc70";
var ReactVersion = "19.0.0-www-modern-6d858044";
function createPortal$1(
children,
@@ -1020,7 +1020,7 @@ if (__DEV__) {
didWarnAboutElementRef[componentName] = true;
error(
"Accessing element.ref is no longer supported. ref is now a " +
"Accessing element.ref was removed in React 19. ref is now a " +
"regular prop. It will be removed from the JSX Element " +
"type in a future release."
);
@@ -2818,7 +2818,7 @@ if (__DEV__) {
console["error"](error);
};
var ReactVersion = "19.0.0-www-modern-af1ea747";
var ReactVersion = "19.0.0-www-modern-a9a0f417";
// Patch fetch
var Children = {
@@ -36,9 +36,9 @@ export default [
"%s objects cannot be rendered as text children. Try formatting it using toString().%s",
"%s received a final argument during this render, but not during the previous render. Even though the final argument is optional, its type cannot change between renders.",
"%s received a final argument that is not an array (instead, received `%s`). When specified, the final argument must be an array.",
"%s uses the legacy childContextTypes API which is no longer supported. Use React.createContext() instead.",
"%s uses the legacy contextTypes API which is no longer supported. Use React.createContext() with React.useContext() instead.",
"%s uses the legacy contextTypes API which is no longer supported. Use React.createContext() with static contextType instead.",
"%s uses the legacy childContextTypes API which was removed in React 19. Use React.createContext() instead.",
"%s uses the legacy contextTypes API which was removed in React 19. Use React.createContext() with React.useContext() instead.",
"%s uses the legacy contextTypes API which was removed in React 19. Use React.createContext() with static contextType instead.",
"%s(...) is deprecated in plain JavaScript React classes. %s",
"%s.childContextTypes is specified but there is no getChildContext() method on the instance. You can either define getChildContext() on %s or remove childContextTypes from it.",
"%s.componentWillMount(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.",
@@ -81,7 +81,7 @@ export default [
"A single row was passed to a <SuspenseList revealOrder=\"%s\" />. This is not useful since it needs multiple rows. Did you mean to pass multiple children or an array?",
"A suspended resource finished loading inside a test, but the event was not wrapped in act(...).\n\nWhen testing, code that resolves suspended data should be wrapped into act(...):\n\nact(() => {\n /* finish loading suspended data */\n});\n/* assert on the output */\n\nThis ensures that you're testing the behavior the user would see in the browser. Learn more at https://react.dev/link/wrap-tests-with-act",
"A view is reporting that a touch occurred on tag zero.",
"Accessing element.ref is no longer supported. ref is now a regular prop. It will be removed from the JSX Element type in a future release.",
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.",
"An empty string (\"\") was passed to the %s attribute. This may cause the browser to download the whole page again over the network. To fix this, either do not render the element at all or pass null to %s instead of an empty string.",
"An empty string (\"\") was passed to the %s attribute. To fix this, either do not render the element at all or pass null to %s instead of an empty string.",
"An error occurred during hydration. The server HTML was replaced with client content in <%s>.",
@@ -243,8 +243,8 @@ export default [
"React.createFactory() is deprecated and will be removed in a future major release. Consider using JSX or use React.createElement() directly instead.",
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.",
"React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",
"ReactDOM.hydrate is no longer supported in React 18. Use hydrateRoot instead",
"ReactDOM.hydrate is no longer supported in React 18. Use hydrateRoot instead. Until you switch to the new API, your app will behave as if it's running React 17. Learn more: https://react.dev/link/switch-to-createroot",
"ReactDOM.hydrate has not been supported since React 18. Use hydrateRoot instead. Until you switch to the new API, your app will behave as if it's running React 17. Learn more: https://react.dev/link/switch-to-createroot",
"ReactDOM.hydrate was removed in React 19. Use hydrateRoot instead",
"ReactDOM.preconnect(): Expected the `crossOrigin` option (second argument) to be a string but encountered %s instead. Try removing this option or passing a string value instead.",
"ReactDOM.preconnect(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.",
"ReactDOM.preconnect(): Expected the `options` argument (second) to be an object but encountered %s instead. The only supported option at this time is `crossOrigin` which accepts a string.",
@@ -258,10 +258,10 @@ export default [
"ReactDOM.preinitModule(): Expected up to two arguments, a non-empty `href` string and, optionally, an `options` object with a valid `as` property.%s",
"ReactDOM.preload(): Expected two arguments, a non-empty `href` string and an `options` object with an `as` property valid for a `<link rel=\"preload\" as=\"...\" />` tag.%s",
"ReactDOM.preloadModule(): Expected two arguments, a non-empty `href` string and, optionally, an `options` object with an `as` property valid for a `<link rel=\"modulepreload\" as=\"...\" />` tag.%s",
"ReactDOM.render is no longer supported in React 18. Use createRoot instead.",
"ReactDOM.render is no longer supported in React 18. Use createRoot instead. Until you switch to the new API, your app will behave as if it's running React 17. Learn more: https://react.dev/link/switch-to-createroot",
"ReactDOM.unstable_renderSubtreeIntoContainer() is no longer supported in React 18. Consider using a portal instead.",
"ReactDOM.unstable_renderSubtreeIntoContainer() is no longer supported in React 18. Consider using a portal instead. Until you switch to the createRoot API, your app will behave as if it's running React 17. Learn more: https://react.dev/link/switch-to-createroot",
"ReactDOM.render has not been supported since React 18. Use createRoot instead. Until you switch to the new API, your app will behave as if it's running React 17. Learn more: https://react.dev/link/switch-to-createroot",
"ReactDOM.render was removed in React 19. Use createRoot instead.",
"ReactDOM.unstable_renderSubtreeIntoContainer() has not been supported since React 18. Consider using a portal instead. Until you switch to the createRoot API, your app will behave as if it's running React 17. Learn more: https://react.dev/link/switch-to-createroot",
"ReactDOM.unstable_renderSubtreeIntoContainer() was removed in React 19. Consider using a portal instead.",
"ReactTestUtils.mockComponent() is deprecated. Use shallow rendering or jest.mock() instead.\n\nSee https://react.dev/link/test-utils-mock-component for more information.",
"Received NaN for the `%s` attribute. If this is expected, cast the value to a string.",
"Received `%s` for a non-boolean attribute `%s`.\n\nIf you want to write it to the DOM, pass a string instead: %s=\"%s\" or %s={value.toString()}.",
@@ -400,7 +400,7 @@ export default [
"renderToNodeStream is deprecated. Use renderToPipeableStream instead.",
"root.finishedLanes should not be empty during a commit. This is a bug in React.",
"sendAccessibilityEvent was called with a ref that isn't a native component. Use React.forwardRef to get access to the underlying native component",
"unmountComponentAtNode is no longer supported in React 18. Use root.unmount() instead.",
"unmountComponentAtNode was removed in React 19. Use root.unmount() instead.",
"unmountComponentAtNode(): The node you're attempting to unmount was rendered by React and is not a top-level container. %s",
"unmountComponentAtNode(): The node you're attempting to unmount was rendered by another copy of React.",
"useFormState is now in canary. Remove the experimental_ prefix. The prefixed alias will be removed in an upcoming release.",