awesome: arbitrary expressions excepted without braces

This commit is contained in:
Jonathan Kelley committed 2021-12-30 03:14:47 -05:00
1 parent 14961023f9
commit 4c85bcfdc8
40 files changed
+825 -767

No files matched your search

+4 -4
View File
@@ -16,18 +16,18 @@ fn main() {
let vdom = VirtualDom::new(App);
let content = ssr::render_vdom_cfg(&vdom, |f| f.pre_render(true));
dioxus::desktop::launch_cfg(App, |c| c.with_prerendered(content));
// dioxus::desktop::launch_cfg(App, |c| c.with_prerendered(content));
}
static App: Component = |cx| {
let mut val = use_state(&cx, || 0);
let val = use_state(&cx, || 0);
cx.render(rsx! {
div {
h1 {"hello world. Count: {val}"}
h1 { "hello world. Count: {val}" }
button {
onclick: move |_| *val.modify() += 1,
"click to increment"
onclick: move |_| val += 1
}
}
})