Disambiguate expressions in rsx by requiring curlies
This commit is contained in:
53 files changed
+399
-373
No files matched your search
@@ -12,11 +12,11 @@ fn app(cx: Scope) -> Element {
|
||||
"asd"
|
||||
Bapp {}
|
||||
}
|
||||
(0..10).map(|f| rsx!{
|
||||
{(0..10).map(|f| rsx!{
|
||||
div {
|
||||
"thing {f}"
|
||||
}
|
||||
})
|
||||
})}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -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"
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
Reference in new issue
Block a user