Function createContext

  • Creates a new context with no default value, thus making its default value undefined.

    Type Parameters

    • T

    Returns Context<T | undefined>

    T Context value type.

  • Creates a new context with a default value.

    Type Parameters

    • T

    Parameters

    • defaultValue: T

    Returns Context<T>

    T Context value type.