#[component]
Expand description
Attribute used to declare a component
The attribute applies to a function, but will transform that function into a type, with a new()
method. By convention, the name of your component should be in UpperCamelCase, and the compiler will warn you if it isn’t.
Example:
#[component]
fn MyComponent(ctx: &CompCtx, props: PropsType) -> impl Element<EventType, LocalState> {
// ...
}