Skip to content

Commit

Permalink
feat: add component generics (#1636)
Browse files Browse the repository at this point in the history
  • Loading branch information
mrvillage authored Sep 4, 2023
1 parent 2ca2488 commit 6e00834
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion leptos_macro/src/view/component_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,11 +147,18 @@ pub(crate) fn component_to_tokens(
}
});

let generics = &node.open_tag.generics;
let generics = if generics.lt_token.is_some() {
quote! { ::#generics }
} else {
quote! {}
};

#[allow(unused_mut)] // used in debug
let mut component = quote! {
::leptos::component_view(
&#name,
::leptos::component_props_builder(&#name)
::leptos::component_props_builder(&#name #generics)
#(#props)*
#(#slots)*
#children
Expand Down

0 comments on commit 6e00834

Please sign in to comment.