#![allow(dead_code)] use iocraft::{components::Box, AnyElement, Hooks}; use iocraft_macros::{component, element, Props}; #[component] fn MyComponent() -> impl Into> { element!(Box) } #[derive(Default, Props)] struct MyProps { foo: String, } #[component] fn MyComponentWithProps(_props: &mut MyProps) -> impl Into> { element!(Box) } #[component] fn MyComponentWithHooks(_hooks: Hooks) -> impl Into> { element!(Box) } #[component] fn MyComponentWithHooksRef(_hooks: &mut Hooks) -> impl Into> { element!(Box) } #[derive(Props)] struct MyGenericProps { foo: [T; U], } #[component] fn MyComponentWithGenericProps( _props: &mut MyGenericProps, ) -> impl Into> { element!(Box) } fn check_component_traits() {} fn check_component_traits_with_generic() { check_component_traits::>(); } #[component] fn MyComponentWithGenericPropsWhereClause( _props: &mut MyGenericProps, ) -> impl Into> where T: 'static, { element!(Box) }