Skip to content

Function: useContainer()

ts
function useContainer(): Container;

Defined in: src/wirestate-react/context/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 service usage, prefer useInjection.

Example

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