fix #1979: generated Owned impl for the props builder was using the wrong generics. (#2027)

This commit fixes the owned impl to use the original generics rather than the build generics.
This commit is contained in:
Jonathan Kelley authored and GitHub committed 2024-03-08 16:49:56 -06:00
1 parent 7461a14cb4
commit dd109f20d2
2 files changed
+35 -4

No files matched your search

@@ -0,0 +1,30 @@
//! Signals can degrade into a ReadOnlySignal variant automatically
//! This is done thanks to a conversion by the #[component] macro
use dioxus::prelude::*;
fn main() {
launch(app);
}
fn app() -> Element {
let mut count = use_signal(|| 0);
rsx! {
h1 { "High-Five counter: {count}" }
button { onclick: move |_| count += 1, "Up high!" }
button { onclick: move |_| count -= 1, "Down low!" }
Child {
count,
"hiiii"
}
}
}
#[component]
fn Child(count: ReadOnlySignal<i32>, children: Element) -> Element {
rsx! {
div { "Count: {count}" }
{children}
}
}