{
  "id": "react/context-provider-missing-value",
  "signature": "Error: Context provider is missing a 'value' prop. The context will receive undefined.",
  "signature_zh": "错误：上下文提供程序缺少'value'属性。上下文将接收undefined。",
  "regex": "Error: Context provider is missing a 'value' prop",
  "domain": "react",
  "category": "runtime_error",
  "subcategory": null,
  "root_cause": "A React Context Provider component is rendered without a 'value' prop, causing consuming components to receive undefined instead of the intended context value.",
  "root_cause_type": "generic",
  "root_cause_zh": "React Context Provider组件在渲染时缺少'value'属性，导致消费组件接收undefined而不是预期的上下文值。",
  "versions": [
    {
      "version": "React 16.3.0",
      "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": "Adding a default value to createContext() to avoid undefined",
      "why_fails": "The default value is only used when there is no Provider at all; if a Provider is present without value, the default is ignored and undefined is passed.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    },
    {
      "action": "Wrapping the Provider in a conditional to skip rendering if no value is available",
      "why_fails": "This may hide the error but leads to missing context for consumers, causing runtime errors later.",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    },
    {
      "action": "Setting value to null explicitly, thinking it's the same as missing",
      "why_fails": "null is a valid value and will be passed; the error is specifically about the prop being absent, not its value.",
      "fail_rate": 0.5,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Ensure the Provider component always includes a 'value' prop, even if it's an empty object or a fallback.",
      "success_rate": 0.95,
      "how": "Ensure the Provider component always includes a 'value' prop, even if it's an empty object or a fallback.",
      "condition": "",
      "sources": []
    },
    {
      "action": "If the value is dynamically computed, use a state variable and pass it as the value prop.",
      "success_rate": 0.9,
      "how": "If the value is dynamically computed, use a state variable and pass it as the value prop.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Ensure the Provider component always includes a 'value' prop, even if it's an empty object or a fallback.",
    "If the value is dynamically computed, use a state variable and pass it as the value prop."
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://react.dev/reference/react/createContext#provider",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.87,
  "fix_success_rate": 0.95,
  "resolvable": "true",
  "first_seen": "2023-09-10",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}