sprocket

Types

Context used by stateful components.

pub type Context

Element that can be rendered

pub type Element

A StatefulComponent is a component that has an associated state, lifecycle and takes props

pub type StatefulComponent(p) =
  fn(//internal, p) -> #(//internal, //internal)

Values

pub fn component(
  c: fn(//internal, p) -> #(//internal, //internal),
  props: p,
) -> //internal

Create a new stateful component element from a given component function and props.

pub fn render(
  ctx: //internal,
  element: //internal,
) -> #(//internal, //internal)

Render an element with the given context.

Search Document