facebook/react · error

hydrate through createRoot is deprecated. Use ReactDOMClient

Error message

hydrate through createRoot is deprecated. Use ReactDOMClient.hydrateRoot(container, <App />) instead.

What it means

Error "hydrate through createRoot is deprecated. Use ReactDOMClient.hydrateRoot(container, <App />) instead." thrown in facebook/react.

Source

Thrown at packages/react-dom/src/client/ReactDOMRoot.js:194

    throw new Error('Target container is not a DOM element.');
  }

  warnIfReactDOMContainerInDEV(container);

  const concurrentUpdatesByDefaultOverride = false;
  let isStrictMode = false;
  let identifierPrefix = '';
  let onUncaughtError = defaultOnUncaughtError;
  let onCaughtError = defaultOnCaughtError;
  let onRecoverableError = defaultOnRecoverableError;
  let onDefaultTransitionIndicator = defaultOnDefaultTransitionIndicator;
  let transitionCallbacks = null;

  // $FlowFixMe[invalid-compare]
  if (options !== null && options !== undefined) {
    if (__DEV__) {
      if ((options as any).hydrate) {
        console.warn(
          'hydrate through createRoot is deprecated. Use ReactDOMClient.hydrateRoot(container, <App />) instead.',
        );
      } else {
        if (
          typeof options === 'object' &&
          // $FlowFixMe[invalid-compare]
          options !== null &&
          (options as any).$$typeof === REACT_ELEMENT_TYPE
        ) {
          console.error(
            'You passed a JSX element to createRoot. You probably meant to ' +
              'call root.render instead. ' +
              'Example usage:\n\n' +
              '  let root = createRoot(domContainer);\n' +
              '  root.render(<App />);',
          );
        }
      }

View on GitHub (pinned to eafeac097b)

When it happens

Trigger: Thrown at packages/react-dom/src/client/ReactDOMRoot.js:194 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of facebook/react@eafeac097b (2026-08-21). Data as JSON: /api/errors/265c0432d33348ac. Report an issue: GitHub.