Skip to content

Function: useContainer() ​

ts
function useContainer(): Container;

Defined in: src/wirestate-react/container/use-container.ts:27

Returns the active container from the context.

Returns ​

Container

The active container.

Remarks ​

Use this hook when you need direct access to the Container for manual resolution or checking bindings. For typical usage, prefer useInjection.

Example ​

tsx
const container: Container = useContainer();
const isBound: boolean = container.has(MyToken);