Fix temporary reads within rsx
This commit is contained in:
1 parent
81e0469cc2
commit
b2607a5b35
1 file changed
+10
-6
+10
-6
@@ -244,12 +244,16 @@ impl<'a> ToTokens for TemplateRenderer<'a> {
|
|||||||
attr_paths: &[ #(#attr_paths),* ],
|
attr_paths: &[ #(#attr_paths),* ],
|
||||||
};
|
};
|
||||||
|
|
||||||
dioxus_core::VNode::new(
|
{
|
||||||
#key_tokens,
|
// NOTE: Allocating a temporary is important to make reads within rsx drop before the value is returned
|
||||||
TEMPLATE,
|
let __vnodes = dioxus_core::VNode::new(
|
||||||
Box::new([ #( #node_printer),* ]),
|
#key_tokens,
|
||||||
Box::new([ #(#dyn_attr_printer),* ]),
|
TEMPLATE,
|
||||||
)
|
Box::new([ #( #node_printer),* ]),
|
||||||
|
Box::new([ #(#dyn_attr_printer),* ]),
|
||||||
|
);
|
||||||
|
__vnodes
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user