sycamore icon indicating copy to clipboard operation
sycamore copied to clipboard

Allow adding derives to generated prop type for `inline_props`

Open lukechu10 opened this issue 1 year ago • 0 comments

Sometimes, the generated prop type needs to implement additional traits which can be derived using a derive macro. This arises in, e.g. mdsycx where the props type needs to derive FromMd so that the component can be used from Markdown.

Currently, we cannot use inline_props in this case because we have no way of specifying addition derives on the generated prop type.

Proposal

Allow #[component(inline_props, derive(FromMd))] which adds a #[derive(FromMd)] onto the generated type.

Possibly even allow arbitrary attributes to be passed in in the same position which would forward them onto the generated type.

lukechu10 avatar Sep 19 '24 17:09 lukechu10