Tweak handling of component children

This commit is contained in:
Greg Johnston 2022-12-10 19:42:08 -05:00
parent 335c040702
commit 9d43eb5503

View file

@ -407,7 +407,7 @@ fn component_to_tokens(
} }
fn component_child(cx: &Ident, node: &Node, mode: Mode) -> TokenStream { fn component_child(cx: &Ident, node: &Node, mode: Mode) -> TokenStream {
let node = match node { match node {
Node::Block(node) => { Node::Block(node) => {
let span = node.value.span(); let span = node.value.span();
let value = node.value.as_ref(); let value = node.value.as_ref();
@ -419,13 +419,15 @@ fn component_child(cx: &Ident, node: &Node, mode: Mode) -> TokenStream {
let span = node.value.span(); let span = node.value.span();
let value = node.value.as_ref(); let value = node.value.as_ref();
quote_spanned! { quote_spanned! {
span => text(#value) span => text(#value).into_view(#cx)
}
}
_ => {
let node = node_to_tokens(cx, node, mode);
quote! {
#node.into_view(#cx)
} }
} }
_ => node_to_tokens(cx, node, mode),
};
quote! {
node.into_view(#cx)
} }
} }