Files
dioxus/packages/core/tests/bubble_error.rs
T
Tristan F.andJonathan Kelley 9167cd9dec fix most typos, add crate-ci/typos to CI (#2653)
* fix most typos, add crate-ci/typos to CI

---------

Co-authored-by: Jonathan Kelley <jkelleyrtp@gmail.com>
2024-07-23 17:49:33 -07:00

29 lines
541 B
Rust

//! we should properly bubble up errors from components
use dioxus::prelude::*;
fn app() -> Element {
let raw = match generation() % 2 {
0 => "123.123",
1 => "123.123.123",
_ => unreachable!(),
};
let value = raw.parse::<f32>().unwrap_or(123.123);
rsx! { div { "hello {value}" } }
}
#[test]
fn bubbles_error() {
let mut dom = VirtualDom::new(app);
{
let _edits = dom.rebuild_to_vec().sanitize();
}
dom.mark_dirty(ScopeId::APP);
_ = dom.render_immediate_to_vec();
}