sycamore
sycamore copied to clipboard
Inline props does not properly support patterns
Describe the bug
Using #[component(inline_props)] does not properly account for using patterns in function parameters.
To Reproduce
#[component(inline_props)]
fn Foo(mut value: i32) -> View {
view! {}
}
The problem occurs when generating code for the prop struct. This is what ends up being generated currently:
#[derive(Props)]
struct FooProps {
mut value: i32
}
where the mut is obviously out of place.
Expected behavior
Patterns work seamlessly with #[component(inline_props)]
Environment
- Sycamore: master
Additional information
Relevant file is packages/sycamore-macro/src/component.rs, specifically the inline_props_impl function.
@lukechu10 i can work on this
@lukechu10 i can work on this
Great! Let's me know if you run into any issues.