use dioxus::prelude::*; // This test just checks that props compile with generics // It will not actually run any code #[test] #[allow(unused)] #[allow(non_snake_case)] fn generic_props_compile() { fn app() -> Element { rsx! { TakesClone { value: "hello world" } TakesCloneManual { value: "hello world" } TakesCloneManualWhere { value: "hello world" } } } #[component] fn TakesClone(value: T) -> Element { rsx! {} } #[derive(Props, Clone, PartialEq)] struct TakesCloneManualProps { value: T, } fn TakesCloneManual(props: TakesCloneManualProps) -> Element { rsx! {} } #[derive(Props, Clone, PartialEq)] struct TakesCloneManualWhereProps where T: Clone + PartialEq + 'static, { value: T, } fn TakesCloneManualWhere( props: TakesCloneManualWhereProps, ) -> Element { rsx! {} } #[derive(Props, Clone, PartialEq)] struct TakesCloneManualWhereWithOwnerProps where T: Clone + PartialEq + 'static, { value: EventHandler, } fn TakesCloneManualWhereWithOwner( props: TakesCloneManualWhereWithOwnerProps, ) -> Element { rsx! {} } }