pub trait Component: 'static + Sized {
    type Routes: Routes;

    fn render(&self, element: Element<'_, Self>);

    fn init(_: &Comp<Self>) { ... }
    fn register_routing_callback(
        _router: &mut <Self::Routes as Routes>::Router,
        _comp: &Comp<Self>
    ) { ... } fn remove_routing_callback(_router: &mut <Self::Routes as Routes>::Router) { ... } fn default_checklist() -> Checklist<Self> { ... } fn default_should_render() -> ShouldRender { ... } fn reset(&mut self) { ... } }

Required Associated Types

Required Methods

Provided Methods

This method allow child-components that wants to receive update when the location changes to register its callback to the router. The root-component (the component that implements spair::Application) does not have to implement this, but must implement spair::Application::init_router. This method will never be called on the root-component.

This method will be called before executing an update method

Implementors