MCPcopy
hub / github.com/jamiebuilds/unstated-next / useContainer

Function useContainer

src/unstated-next.tsx:23–29  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

21 }
22
23 function useContainer(): Value {
24 let value = React.useContext(Context)
25 if (value === null) {
26 throw new Error("Component must be wrapped with <Container.Provider>")
27 }
28 return value
29 }
30
31 return { Provider, useContainer }
32}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…