sycamore
sycamore copied to clipboard
Support `impl Trait` syntax with `inline_props`
Right now, inline_props does not support the impl Trait syntax which is often useful to prevent adding tons of generics to a function.
We would like the following syntax to work out of the box:
#[component(inline_props]
fn MyComponent<G: Html>(cx: Scope, foo: impl MyTrait) -> View<G> {
...
}
The difficulty with this is that we cannot directly translate impl MyTrait into a struct field because this syntax is only supported for functions. We therefore need to manually transform the impl MyTrait into an explicit generic parameter in the generated struct.