Fix component macro with where clause (#3951)
This commit is contained in:
1 parent
589440b9cb
commit
cbb91d694f
2 files changed
+17
-1
No files matched your search
@@ -1,3 +1,5 @@
|
||||
use std::fmt::Display;
|
||||
|
||||
use dioxus::prelude::*;
|
||||
|
||||
// This test just checks that props compile with generics
|
||||
@@ -17,6 +19,9 @@ fn generic_props_compile() {
|
||||
TakesCloneManualWhere {
|
||||
value: "hello world"
|
||||
}
|
||||
GenericFnWhereClause {
|
||||
value: "hello world"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -61,4 +66,14 @@ fn generic_props_compile() {
|
||||
) -> Element {
|
||||
rsx! {}
|
||||
}
|
||||
|
||||
#[component]
|
||||
fn GenericFnWhereClause<T>(value: T) -> Element
|
||||
where
|
||||
T: Clone + PartialEq + Display + 'static,
|
||||
{
|
||||
rsx! {
|
||||
p { "{value}" }
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user