{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "get-strict-context",
  "title": "Get strict context",
  "description": "Library utility: get-strict-context",
  "dependencies": [],
  "registryDependencies": [],
  "files": [
    {
      "path": "registry/optics/lib/get-strict-context.jsx",
      "content": "import * as React from \"react\";\n\nfunction getStrictContext(name) {\n\tconst Context = React.createContext(undefined);\n\n\tconst Provider = ({ value, children }) => (\n\t\t<Context.Provider value={value}>{children}</Context.Provider>\n\t);\n\n\tconst useSafeContext = () => {\n\t\tconst ctx = React.useContext(Context);\n\t\tif (ctx === undefined) {\n\t\t\tthrow new Error(`useContext must be used within ${name ?? \"a Provider\"}`);\n\t\t}\n\t\treturn ctx;\n\t};\n\n\treturn [Provider, useSafeContext];\n}\n\nexport { getStrictContext };\n",
      "type": "registry:lib",
      "target": "lib/get-strict-context.jsx"
    }
  ],
  "type": "registry:lib"
}