Skip to main content

component

Attribute Macro component 

Source
#[component]
Expand description

Marks a function as a UI component.

§Features

  • Validates the function signature and returns helpful errors.
  • Injects a default second argument when one is not provided.

§Example

#[component]
fn HelloWorld(c: Component) -> Node {
    c.compose(|_| {})
}