use crate::event::{ComponentEvent, EventResult};
use crate::props::Props;
use crate::render::RenderOutput;
use crate::state::State;
pub trait Component: Sized + 'static {
type Props: Props;
type State: State;
fn initial_state(props: &Self::Props) -> Self::State;
fn render(props: &Self::Props, state: &Self::State) -> RenderOutput;
fn on_event(
props: &Self::Props,
state: &mut Self::State,
event: ComponentEvent,
) -> EventResult;
fn props_changed(
_old_props: &Self::Props,
_new_props: &Self::Props,
_state: &mut Self::State,
) -> bool {
false
}
fn cleanup(_props: &Self::Props, _state: &mut Self::State) {}
}