Skip to content

//workflow/com.squareup.workflow1/BaseRenderContext/renderChild

renderChild

[jvm]
Content
abstract fun <ChildPropsT, ChildOutputT, ChildRenderingT> renderChild(child: Workflow<ChildPropsT, ChildOutputT, ChildRenderingT>, props: ChildPropsT, key: String = “”, handler: (ChildOutputT) -> WorkflowAction<PropsT, StateT, OutputT>): ChildRenderingT
More info

Ensures child is running as a child of this workflow, and returns the result of its render method.

Never call StatefulWorkflow.render or StatelessWorkflow.render directly, always do it through this context method.

  1. If the child *wasn't* already running, it will be started either from [initialState](../-stateful-workflow/initial-state.md) or its snapshot.
  2. If the child *was* already running, The workflow's [onPropsChanged](../-stateful-workflow/on-props-changed.md) method is invoked with the previous input and this one.
  3. The child's render method is invoked with input and the child's state.

After this method returns, if something happens that trigger’s one of child’s handlers, and that handler emits an output, the function passed as handler will be invoked with that output.

Parameters

jvm

key

An optional string key that is used to distinguish between workflows of the same type.