Function DependencyModule

  • Binds the module to a new dependency container.

    If a parent container is exist, it is connected to the current one by default.

    Example

    const LOGGER_MODULE: ModuleDeclaration<LoggerModule> = {

    function App() {
    return (
    <DependencyModule module={LOGGER_MODULE}>
    <NestedComponent />
    </DependencyModule>
    );
    }

    Parameters

    • params: {
          children: ReactNode;
          module: ModuleDeclaration<Module<Record<string, unknown>>>;
          scope?: "scoped" | "singleton";
      }
      • children: ReactNode
      • module: ModuleDeclaration<Module<Record<string, unknown>>>

        Module declaration for binding

      • Optional scope?: "scoped" | "singleton"

        Optional scope for binding: singleton (default) or scoped.

    Returns ReactElement

Generated using TypeDoc