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.

Required Methods§

source

fn render(self: Box<Self>, hooks: &mut Hooks<'_>) -> Element

Render the virtual tree for this component.

Implementations on Foreign Types§

source§

impl<T: ElementComponent + Clone + 'static> ElementComponent for Vec<T>

source§

fn render(self: Box<Self>, _: &mut Hooks<'_>) -> Element

source§

impl<T: ElementComponent + Clone + 'static> ElementComponent for HashMap<String, T>

source§

fn render(self: Box<Self>, _: &mut Hooks<'_>) -> Element

Implementors§