dioxus
dioxus copied to clipboard
Returning Early RSX Causes an Error on Desktop Windows
Problem
When running a Desktop app on Windows 10, early RSX returns are not rendered and an error is shown in the console.
Steps To Reproduce
Run this component on the Dioxus Desktop platform in a Windows environment.
fn app() -> Element {
let mut data = use_signal(|| false);
if data() {
println!("RAN1");
rsx!("true")
} else {
println!("RAN2");
data.set(true);
rsx!("false")
}
}
Expected behavior
true should be displayed instead of false.
Screenshots
This error is shown is the console when the true branch of the if statement is ran.
Environment:
- Dioxus version:
main,0.5 - Rust version:
1.77.1 - OS info:
Windows 10 - App platform:
Desktop
~~This also happens with if, else if and else statements inside of RSX blocks:~~
fn app() -> Element {
let mut data = use_signal(|| false);
rsx! {
if data() {
"true"
} else {
{data.set(true)}
"false"
}
}
}
Also happens on release.
Scratch this. It's not based on conditionals but rather seems based around how quickly a signal or hook is updated.