@JsType(isNative=true,
namespace="<global>",
name="Object")
public final class Context<T>
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
Context.ConsumerBuilder<ST>
A Builder for the Consumer component.
|
static interface |
Context.ConsumerRenderFunction<T>
Interface used to type the render function input.
|
static class |
Context.ProviderBuilder<ST>
A Builder for the Provider component.
|
Constructor and Description |
---|
Context() |
Modifier and Type | Method and Description |
---|---|
Context.ConsumerBuilder<T> |
consumer()
Create a builder for the Consumer component.
|
ReactNode |
provide(T value,
ReactNode... children)
Create a provider component that provides specified value to specified children.
|
Context.ProviderBuilder<T> |
provider()
Create a builder for the Provider component.
|
@JsOverlay @Nonnull public Context.ProviderBuilder<T> provider()
@JsOverlay @Nonnull public ReactNode provide(@Nullable T value, ReactNode... children)
value
- the value to provider to children.children
- the child elements.@JsOverlay @Nonnull public Context.ConsumerBuilder<T> consumer()