generic_component.rs 279 B

12345678910111213141516171819
  1. use std::fmt::Display;
  2. use dioxus::prelude::*;
  3. fn main() {
  4. dioxus_desktop::launch(app);
  5. }
  6. fn app(cx: Scope) -> Element {
  7. cx.render(rsx! {
  8. generic_child::<i32>{}
  9. })
  10. }
  11. fn generic_child<T>(cx: Scope) -> Element {
  12. cx.render(rsx! {
  13. div {}
  14. })
  15. }