Merge branch 'master' into implement-file-engine

This commit is contained in:
Jonathan Kelley committed 2023-04-26 15:32:34 -07:00
commit 22cfff647c
12 files changed
+259 -61

No files matched your search

+1 -1
View File
@@ -11,7 +11,7 @@ fn App(cx: Scope) -> Element {
cx.render(rsx! {
input {
r#type: "file",
accept: ".txt",
accept: ".txt, .rs",
multiple: true,
onchange: |evt| {
to_owned![files_uploaded];
+16 -3
View File
@@ -1,3 +1,5 @@
use std::fmt::Display;
use dioxus::prelude::*;
fn main() {
@@ -5,9 +7,20 @@ fn main() {
}
fn app(cx: Scope) -> Element {
cx.render(rsx! { generic_child::<i32>{} })
cx.render(rsx! { generic_child {
data: 0i32
} })
}
fn generic_child<T>(cx: Scope) -> Element {
cx.render(rsx! { div {} })
#[derive(PartialEq, Props)]
struct GenericChildProps<T: Display + PartialEq> {
data: T,
}
fn generic_child<T: Display + PartialEq>(cx: Scope<GenericChildProps<T>>) -> Element {
let data = &cx.props.data;
cx.render(rsx! { div {
"{data}"
} })
}