---
source: leptos_macro/src/view/tests.rs
expression: pretty(result)
---
fn view() {
    {
        thread_local! {
            static __TEMPLATE : ::leptos::web_sys::HtmlTemplateElement = { let document =
            ::leptos::document(); let el = document.create_element("template").unwrap();
            el
            .set_inner_html("<div><button>Clear</button><button>-1</button><span>Value: <!>!</span><button>+1</button></div>");
            ::leptos::wasm_bindgen::JsCast::unchecked_into(el) }
        }
        let _ = ::leptos::leptos_dom::html::div;
        let _ = ::leptos::leptos_dom::html::div;
        let _ = ::leptos::leptos_dom::html::button;
        let _ = ::leptos::leptos_dom::html::button;
        let _ = ::leptos::leptos_dom::html::button;
        let _ = ::leptos::leptos_dom::html::button;
        let _ = ::leptos::leptos_dom::html::span;
        let _ = ::leptos::leptos_dom::html::span;
        let _ = ::leptos::leptos_dom::html::button;
        let _ = ::leptos::leptos_dom::html::button;
        let root = __TEMPLATE
            .with(|tpl| tpl.content().clone_node_with_deep(true))
            .unwrap()
            .first_child()
            .unwrap();
        let _el1 = "div";
        let _el1 = ::leptos::wasm_bindgen::JsCast::unchecked_into::<
            leptos::web_sys::Node,
        >(root.clone());
        let _el2 = "button";
        let _el2 = _el1
            .first_child()
            .unwrap_or_else(|| panic!("error: {} => {}", "button", "firstChild"));
        let _el3 = _el2
            .first_child()
            .unwrap_or_else(|| panic!("error : {} => {} ", "{block}", "firstChild"));
        let _el4 = "button";
        let _el4 = _el2
            .next_sibling()
            .unwrap_or_else(|| panic!("error : {} => {} ", "button", "nextSibling"));
        let _el5 = _el4
            .first_child()
            .unwrap_or_else(|| panic!("error : {} => {} ", "{block}", "firstChild"));
        let _el6 = "span";
        let _el6 = _el4
            .next_sibling()
            .unwrap_or_else(|| panic!("error : {} => {} ", "span", "nextSibling"));
        let _el7 = _el6
            .first_child()
            .unwrap_or_else(|| panic!("error : {} => {} ", "{block}", "firstChild"));
        let _el8 = _el7
            .next_sibling()
            .unwrap_or_else(|| panic!("error : {} => {} ", "{block}", "nextSibling"));
        let _el9 = _el8
            .next_sibling()
            .unwrap_or_else(|| panic!("error : {} => {} ", "{block}", "nextSibling"));
        let _el10 = "button";
        let _el10 = _el6
            .next_sibling()
            .unwrap_or_else(|| panic!("error : {} => {} ", "button", "nextSibling"));
        let _el11 = _el10
            .first_child()
            .unwrap_or_else(|| panic!("error : {} => {} ", "{block}", "firstChild"));
        ::leptos::leptos_dom::add_event_helper(
            ::leptos::wasm_bindgen::JsCast::unchecked_ref(&_el2),
            ::leptos::leptos_dom::ev::click,
            move |_| set_value(0),
        );
        ::leptos::leptos_dom::add_event_helper(
            ::leptos::wasm_bindgen::JsCast::unchecked_ref(&_el4),
            ::leptos::leptos_dom::ev::click,
            move |_| set_value.update(|value| *value -= step),
        );
        ::leptos::leptos_dom::mount_child(
            ::leptos::leptos_dom::MountKind::Before(&_el8.clone()),
            &{ { value } }.into_view(cx),
        );
        ::leptos::leptos_dom::add_event_helper(
            ::leptos::wasm_bindgen::JsCast::unchecked_ref(&_el10),
            ::leptos::leptos_dom::ev::click,
            move |_| set_value.update(|value| *value += step),
        );
        ::leptos::leptos_dom::View::Element(leptos::leptos_dom::Element {
            #[cfg(debug_assertions)]
            name: "div".into(),
            element: ::leptos::wasm_bindgen::JsCast::unchecked_into(root),
            #[cfg(debug_assertions)]
            view_marker: None,
        })
    }
}

