pub trait FunctionProvider {
    type Properties: Properties + PartialEq;

    // Required method
    fn run(
        ctx: &mut HookContext,
        props: &Self::Properties
    ) -> Result<VNode, RenderError>;
}
Expand description

Trait that allows a struct to act as Function Component.

Required Associated Types§

source

type Properties: Properties + PartialEq

Properties for the Function Component.

Required Methods§

source

fn run( ctx: &mut HookContext, props: &Self::Properties ) -> Result<VNode, RenderError>

Render the component. This function returns the Html to be rendered for the component.

Equivalent of Component::view.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl FunctionProvider for Global

source§

impl FunctionProvider for ManagerProvider

source§

impl FunctionProvider for BrowserRouter

source§

impl FunctionProvider for HashRouter

source§

impl FunctionProvider for Router

source§

impl<R> FunctionProvider for Redirect<R>
where R: Routable + 'static,

source§

impl<R> FunctionProvider for Switch<R>
where R: Routable + 'static,

source§

impl<R, Q, S> FunctionProvider for Link<R, Q, S>
where R: Routable + 'static, Q: Clone + PartialEq + Serialize + 'static, S: Clone + PartialEq + 'static,

§

type Properties = LinkProps<R, Q, S>

source§

fn run( ctx: &mut HookContext, props: &<Link<R, Q, S> as FunctionProvider>::Properties ) -> Result<VNode, RenderError>

Implementors§