moved body back inside itself to allow forwarding attributes

This commit is contained in:
Jose Quesada 2022-12-14 12:57:43 -06:00
parent 5f95776a08
commit 218c4d3c90

View file

@ -104,8 +104,6 @@ impl ToTokens for Model {
let component_fn_prop_docs = generate_component_fn_prop_docs(props);
let body = &body.block;
let output = quote! {
#[doc = "Props for the [`"]
#[doc = #name_stringified]
@ -122,13 +120,15 @@ impl ToTokens for Model {
#vis fn #name #generics (#scope_name: Scope, props: #props_name #generics) #ret
#where_clause
{
#body
let #props_name {
#prop_names
} = props;
leptos::Component::new(
stringify!(#name),
move |#scope_name| { #body }
move |cx| #name(cx, #prop_names)
)
}
};