pub trait Component: Send + Sync {
// Required method
fn render(&self) -> VNode;
// Provided methods
fn init(&mut self) { ... }
fn update(&mut self) { ... }
fn cleanup(&mut self) { ... }
}Expand description
Trait for components
Note: The render() method should be implemented as a regular method,
not as part of this trait. The #[component] macro will ensure the
struct implements this trait.