Trait ambient_element::ElementComponent
source · pub trait ElementComponent: Debug + ElementComponentName + DynClone + Sync + Send {
// Required method
fn render(self: Box<Self>, hooks: &mut Hooks<'_>) -> Element;
}
Expand description
The base trait for all element components. These are similar to React components.
The render
method is called to create the virtual tree for this component.
It will only be called when the component is first created, or when one of its dependencies changes.
These dependencies can include properties or state introduced by Hooks.