Package react4j

Class Context.ConsumerBuilder<ST>

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

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

    • key

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

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