Trait yew::html::BaseComponent

source ·
pub trait BaseComponent: Sized + 'static {
    type Message: 'static;
    type Properties: Properties;

    fn create(ctx: &Context<Self>) -> Self;
    fn update(&mut self, ctx: &Context<Self>, msg: Self::Message) -> bool;
    fn changed(
        &mut self,
        ctx: &Context<Self>,
        _old_props: &Self::Properties
    ) -> bool; fn view(&self, ctx: &Context<Self>) -> HtmlResult; fn rendered(&mut self, ctx: &Context<Self>, first_render: bool); fn destroy(&mut self, ctx: &Context<Self>); fn prepare_state(&self) -> Option<String>; }
Expand description

The common base of both function components and struct components.

If you are taken here by doc links, you might be looking for Component or #[function_component].

We provide a blanket implementation of this trait for every member that implements Component.

Warning

This trait may be subject to heavy changes between versions and is not intended for direct implementation.

You should used the Component trait or the #[function_component] macro to define your components.

Required Associated Types§

The Component’s Message.

The Component’s Properties.

Required Methods§

Creates a component.

Updates component’s internal state.

React to changes of component properties.

Returns a component layout to be rendered.

Notified after a layout is rendered.

Notified before a component is destroyed.

Prepares the server-side state.

Implementors§