facebook/react · error · Error

93

93

Error message

<textarea> can only have at most one child.

What it means

Error "<textarea> can only have at most one child." thrown in facebook/react.

Source

Thrown at packages/react-dom-bindings/src/client/ReactDOMTextarea.js:115

  children: ?string,
) {
  const node: HTMLTextAreaElement = element as any;

  let initialValue = value;

  // Only bother fetching default value if we're going to use it
  if (initialValue == null) {
    if (children != null) {
      if (!disableTextareaChildren) {
        if (defaultValue != null) {
          throw new Error(
            'If you supply `defaultValue` on a <textarea>, do not pass children.',
          );
        }

        if (isArray(children)) {
          if (children.length > 1) {
            throw new Error('<textarea> can only have at most one child.');
          }

          children = children[0];
        }

        defaultValue = children;
      }
    }
    if (defaultValue == null) {
      defaultValue = '';
    }
    initialValue = defaultValue;
  }

  const stringValue = getToStringValue(initialValue);
  node.defaultValue = stringValue as any; // This will be toString:ed.

  // This is in postMount because we need access to the DOM node, which is not

View on GitHub (pinned to eafeac097b)

When it happens

Trigger: Thrown at packages/react-dom-bindings/src/client/ReactDOMTextarea.js:115 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/4713462fdb83abdb. Report an issue: GitHub.