Trait sycamore::component::Component[][src]

pub trait Component<G: GenericNode> {
    type Props;

    const NAME: &'static str;

    fn __create_component(props: Self::Props) -> Template<G>;
}
Expand description

Trait that is implemented by components. Should not be implemented manually. Use the component macro instead.

Associated Types

The type of the properties passed to the component.

Associated Constants

The name of the component (for use in debug mode). In release mode, this will default to "UnnamedComponent"

Required methods

Create a new component with an instance of the properties.

The double underscores (__) are to prevent conflicts with other trait methods. This is because we cannot use fully qualified syntax here because it prevents type inference.

Implementors