Disambiguate expressions in rsx by requiring curlies

This commit is contained in:
Jonathan Kelley committed 2024-01-10 19:33:34 -08:00
1 parent 663296ae45
commit d9b84f9f8f
53 files changed
+399 -373

No files matched your search

+5 -2
View File
@@ -24,8 +24,11 @@ fn app(cx: Scope) -> Element {
start();
*count.write() += 1;
},
// format is needed as {count} does not seemed to work in `if` within content
if **started { format!("Current score: {}", count.write()) } else { "Start".to_string() }
if **started {
"Current score: {count.read()}"
} else {
"Start"
}
}
})
}