Class Context.ConsumerBuilder<ST extends @Nullable Object>

java.lang.Object
react4j.Context.ConsumerBuilder<ST>
Enclosing class:
Context<T extends @Nullable Object>

public static final class Context.ConsumerBuilder<ST extends @Nullable Object> extends Object
A Builder for the Consumer component. A Consumer component is a react component that subscribes to context changes.
  • Method Details

    • key

      public Context.ConsumerBuilder<ST> key(String key)
      Specify the key for component if required.
      Parameters:
      key - the key for the component.
      Returns:
      the builder.
    • render

      public ReactNode render(Context.ConsumerRenderFunction<ST> render)
      Specify the child render function.
      Parameters:
      render - the child render function.
      Returns:
      the creates react node.