diff --git a/docs/guide/examples/readme_expanded.rs b/docs/guide/examples/readme_expanded.rs index 5e09aee56..8b9abfa20 100644 --- a/docs/guide/examples/readme_expanded.rs +++ b/docs/guide/examples/readme_expanded.rs @@ -84,24 +84,22 @@ fn app(cx: Scope) -> Element { ], }; // The VNode is a reference to the template with the dynamic parts of the rsx - ::dioxus::core::VNode { - parent: Default::default(), - key: None, + ::dioxus::core::VNode::new( + None, // The static template this node will use. The template is stored in a Cell so it can be replaced with a new template when hot rsx reloading is enabled - template: std::cell::Cell::new(TEMPLATE), - root_ids: dioxus::core::exports::bumpalo::collections::Vec::new_in(__cx.bump()) - .into(), - dynamic_nodes: __cx.bump().alloc([ + TEMPLATE, + dioxus::core::exports::bumpalo::collections::Vec::new_in(__cx.bump()), + __cx.bump().alloc([ // The dynamic count text node (dynamic node id 0) __cx.text_node(format_args!("High-Five counter: {0}", count)), ]), - dynamic_attrs: __cx.bump().alloc([ + __cx.bump().alloc([ // The dynamic up high button onclick listener (dynamic attribute id 0) dioxus_elements::events::onclick(__cx, move |_| count += 1), // The dynamic down low button onclick listener (dynamic attribute id 1) dioxus_elements::events::onclick(__cx, move |_| count -= 1), ]), - } + ) }, ), )