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
contextComponentContext<T>Context object whose value is being provided.
valueTValue visible to descendants via
Hooks.UseContext(context).childrenVNode[]Descendant VNodes that observe this provider.
keystringKey used to disambiguate siblings at the same position.
Returns
- ContextProviderNode<T>
The created ContextProviderNode<T>.
Type Parameters
TContext value type.