Fix hydration with empty spread attributes (#4647)

* Fix hydration of empty spread attributes

* add a regression test

* fix doctest
This commit is contained in:
Evan Almloff authored and GitHub committed 2025-10-03 19:41:23 -07:00
1 parent f48aec7eff
commit 03801e1312
8 files changed
+94 -2

No files matched your search

@@ -0,0 +1,40 @@
//! Regression test for <https://github.com/DioxusLabs/dioxus/issues/4646>
use dioxus::prelude::*;
fn main() {
dioxus::launch(|| {
rsx! {
Comp {}
Comp {}
Button {}
}
});
}
#[component]
fn Button() -> Element {
let mut count = use_signal(|| 0);
rsx! {
button {
id: "counter",
onclick: move |_| {
count += 1;
},
"Count: {count}"
}
}
}
#[component]
fn Comp(#[props(extends = GlobalAttributes)] attributes: Vec<Attribute>) -> Element {
rsx! {
div {
width: 100,
div {
..attributes,
}
}
}
}