child

fun child(component: Component?, id: Any? = null, isSticky: Boolean = false, onNearViewport: OnNearCallback? = null, parentWidthPercent: Float = -1f, parentHeightPercent: Float = -1f)

Add a child Component to the Lazy Collection.

Parameters

component

The component to add

id

A unique identifier for the child

isSticky

Fix the child to the top of the collection if it is scrolled out of view

onNearViewport

A callback that will be invoked when the child is close to or enters the visible area.

parentWidthPercent

Percentage value(0-100) of the width of the parent container to fill

parentHeightPercent

Percentage value(0-100) of the height of the parent container to fill


fun child(id: Any? = null, isSticky: Boolean = false, onNearViewport: OnNearCallback? = null, deps: Array<Any?>, parentWidthPercent: Float = -1f, parentHeightPercent: Float = -1f, componentFunction: ComponentCreationScope.() -> Component?)

Add a child Component created by the provided componentFunction function to the Lazy Collection.

The Component will be created by invoking componentFunction when the child is first rendered. The Component will be reused in subsequent renders unless there is a change to deps. deps is an array of dependencies that should contain any props or state that are used inside componentFunction.

Parameters

id

A unique identifier for the child

isSticky

Fix the child to the top of the collection if it is scrolled out of view

onNearViewport

A callback that will be invoked when the child is close to or enters the visible area.

parentWidthPercent

Percentage value(0-100) of the width of the parent container to fill

parentHeightPercent

Percentage value(0-100) of the height of the parent container to fill

deps

An array of prop and state values used by componentFunction to create the Component. A change to one of these values will cause componentFunction to recreate the Component.

componentFunction

A function that returns a Component