Skip to main content
Skip to main content

Guides

In-depth guides for specific HexDI use cases and integrations.

Available Guides

React Integration

Complete guide to using HexDI with React applications:

  • Setting up typed hooks and providers
  • Using ContainerProvider, ScopeProvider, and AutoScopeProvider
  • Scope lifecycle management
  • SSR considerations

Testing Strategies

How to test HexDI-powered applications:

  • Unit testing adapters with createAdapterTest()
  • Integration testing with TestGraphBuilder
  • Creating mock adapters with createMockAdapter()
  • Component testing with renderWithContainer()
  • Vitest integration with useTestContainer()

Error Handling

Understanding and handling HexDI errors:

  • Error hierarchy and error codes
  • Handling CircularDependencyError
  • Handling FactoryError
  • Best practices for error recovery
I want to...Guide
Use HexDI in a React appReact Integration
Write tests for my servicesTesting Strategies
Understand runtime errorsError Handling
Mock dependencies in testsTesting Strategies