Skip to main content

useOptionalViewController

Callable

  • useOptionalViewController<TContext, TService>(declaration: ControllerDeclaration<TContext, TService>): TService | undefined
  • useOptionalViewController<TContext, TService, TDefault>(declaration: ControllerDeclaration<TContext, TService>, defaultValue: TDefault): TService | TDefault

  • Returns parent's view controller that is provided for the given controller declaration.

    Optional view controller can be used when the controller is not provided in the context.


    Type parameters

    Parameters

    Returns TService | undefined