facebook/react · error · Error

450

450

Error message

The current renderer does not support Singletons. This error is likely caused by a bug in React. Please file an issue.

What it means

Singletons are host nodes that must exist exactly once — in react-dom, <html>, <head>, and <body>. Renderers that don't implement singletons re-export ReactFiberConfigWithNoSingletons, where resolveSingletonInstance, acquireSingletonInstance, releaseSingletonInstance, and isHostSingletonType are throwing shims (`supportsSingletons = false`). Rendering a document-level element against such a config throws.

Source

Thrown at packages/react-reconciler/src/ReactFiberConfigWithNoSingletons.js:14

/**
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 *
 * @flow
 */

// Renderers that don't support mutation
// can re-export everything from this module.

function shim(...args: any): any {
  throw new Error(
    'The current renderer does not support Singletons. ' +
      'This error is likely caused by a bug in React. ' +
      'Please file an issue.',
  );
}

// Resources (when unsupported)
export const supportsSingletons = false;
export const resolveSingletonInstance = shim;
export const acquireSingletonInstance = shim;
export const releaseSingletonInstance = shim;
export const isHostSingletonType = shim;
export const isSingletonScope = shim;

View on GitHub (pinned to eafeac097b)

Solutions

  1. Don't render document-level tags on non-DOM renderers — branch on environment and render only the inner content.
  2. Strip the document shell before passing the tree to the non-DOM renderer.
  3. Custom renderer authors: implement the singleton hooks if your target has singleton-like nodes.

Example fix

// before: document shell rendered everywhere
const Shell = ({children}) => (
  <html><body>{children}</body></html>
);

// after: shell only for DOM renderers
const Shell = ({children}) =>
  isDom ? <html><body>{children}</body></html> : <>{children}</>;
Defensive patterns

Strategy: type-guard

Validate before calling

// Strip document-level elements before rendering into non-DOM renderers
const tree = isDom
  ? <AppShell>{app}</AppShell> // renders html/head/body
  : <>{app}</>;

Type guard

const SINGLETON_TAGS = new Set(['html', 'head', 'body']);
function isSingletonHostElement(element) {
  return Boolean(element) && typeof element === 'object' && SINGLETON_TAGS.has(element.type);
}

Prevention

When it happens

Trigger: Rendering 'html', 'head', or 'body' elements in a tree driven by a renderer whose host config re-exports NoSingletons — react-native, test renderers, custom renderers.

Common situations: Reusing full-document components (SSD-style <html> wrappers, A JSX component) on react-native or custom renderers; shared design-system components that render document shells.

Related errors


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