{
  "id": "react/invalid-array-child",
  "signature": "Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: object. Check the render method of `App`.",
  "signature_zh": "错误：元素类型无效：期望一个字符串（用于内置组件）或一个类/函数（用于复合组件），但得到了对象。请检查 `App` 的 render 方法。",
  "regex": "Element type is invalid: expected a string \\(for built-in components\\) or a class/function \\(for composite components\\) but got: object",
  "domain": "react",
  "category": "runtime_error",
  "subcategory": null,
  "root_cause": "A component's render method returned an array containing non-React-element objects, such as plain JavaScript objects or unrendered component classes, instead of valid React elements.",
  "root_cause_type": "generic",
  "root_cause_zh": "组件的 render 方法返回了一个包含非 React 元素对象的数组，例如纯 JavaScript 对象或未渲染的组件类，而不是有效的 React 元素。",
  "versions": [
    {
      "version": "React 16.8+",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "React 17.0.2",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "React 18.2.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Wrapping the object in a <div> or fragment",
      "why_fails": "If the object is not a valid React element, wrapping it won't fix the underlying issue—it will just produce a different error or render nothing.",
      "fail_rate": 0.4,
      "condition": "",
      "sources": []
    },
    {
      "action": "Using JSON.stringify on the object",
      "why_fails": "This converts the object to a string, which may be displayed but is not a valid React child and can cause hydration mismatches.",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    },
    {
      "action": "Importing the component as default instead of named",
      "why_fails": "If the object is a plain JS object (e.g., from an API), no import style will make it a valid component.",
      "fail_rate": 0.5,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "If you meant to render a list of components, ensure each item is a React element: data.map(item => <Component key={item.id} />). If you meant to display an object, use JSON.stringify(object) or access specific properties.",
      "success_rate": 0.9,
      "how": "If you meant to render a list of components, ensure each item is a React element: data.map(item => <Component key={item.id} />). If you meant to display an object, use JSON.stringify(object) or access specific properties.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Check that you are not accidentally passing a component class instead of an instance: <Component /> not Component alone.",
      "success_rate": 0.85,
      "how": "Check that you are not accidentally passing a component class instead of an instance: <Component /> not Component alone.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "If you meant to render a list of components, ensure each item is a React element: data.map(item => <Component key={item.id} />). If you meant to display an object, use JSON.stringify(object) or access specific properties.",
    "Check that you are not accidentally passing a component class instead of an instance: <Component /> not Component alone."
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://reactjs.org/docs/error-decoder.html/?invariant=31",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.82,
  "fix_success_rate": 0.85,
  "resolvable": "true",
  "first_seen": "2023-06-10",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}