Table of Contents

Method Provider

Namespace
Velvet
Assembly
Velvet.Docs.dll

Provider<T>(ComponentContext<T>, T, VNode?[]?, string?)

Provides a context value to the descendant subtree, visible to descendants that read the same context via Hooks.UseContext.

public static ContextProviderNode<T> Provider<T>(ComponentContext<T> context, T value, VNode?[]? children = null, string? key = null)

Parameters

context ComponentContext<T>

Context object whose value is being provided.

value T

Value visible to descendants via Hooks.UseContext(context).

children VNode[]

Descendant VNodes that observe this provider.

key string

Key used to disambiguate siblings at the same position.

Returns

ContextProviderNode<T>

The created ContextProviderNode<T>.

Type Parameters

T

Context value type.