Fix hydration with empty spread attributes (#4647)
* Fix hydration of empty spread attributes * add a regression test * fix doctest
This commit is contained in:
1 parent
f48aec7eff
commit
03801e1312
8 files changed
+94
-2
No files matched your search
@@ -0,0 +1,15 @@
|
||||
[package]
|
||||
name = "dioxus-playwright-fullstack-spread-test"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
publish = false
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
dioxus = { workspace = true, features = ["fullstack"] }
|
||||
|
||||
[features]
|
||||
default = []
|
||||
server = ["dioxus/server"]
|
||||
web = ["dioxus/web"]
|
||||
@@ -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,
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user