Correct use of `cx`

This commit is contained in:
Greg Johnston 2022-12-13 15:14:41 -05:00
parent cc0bf20c9d
commit 5e06eb1a99
1 changed files with 4 additions and 4 deletions

View File

@ -244,7 +244,7 @@ fn element_to_tokens(
Node::Comment(_) | Node::Doctype(_) | Node::Attribute(_) => quote! {}, Node::Comment(_) | Node::Doctype(_) | Node::Attribute(_) => quote! {},
}; };
quote! { quote! {
.child((cx, #child)) .child((#cx, #child))
} }
}); });
quote_spanned! { quote_spanned! {
@ -319,7 +319,7 @@ fn attribute_to_tokens(
.as_ref(); .as_ref();
//if mode != Mode::Ssr { //if mode != Mode::Ssr {
quote_spanned! { quote_spanned! {
span => .class(#name, (cx, #[allow(unused_braces)] #value)) span => .class(#name, (#cx, #[allow(unused_braces)] #value))
} }
/* } else { /* } else {
todo!() todo!()
@ -358,7 +358,7 @@ fn component_to_tokens(
let children = if node.children.is_empty() { let children = if node.children.is_empty() {
quote! { } quote! { }
} else { } else {
let children = fragment_to_tokens(&Ident::new("cx", span), span, &node.children, mode); let children = fragment_to_tokens(cx, span, &node.children, mode);
quote! { .children(Box::new(move |#cx| #children)) } quote! { .children(Box::new(move |#cx| #children)) }
}; };
@ -391,7 +391,7 @@ fn component_to_tokens(
quote_spanned! { quote_spanned! {
span => #name( span => #name(
cx, #cx,
#component_props_name::builder() #component_props_name::builder()
#(#props)* #(#props)*
#children #children