Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inline props does not properly support patterns #718

Closed
lukechu10 opened this issue Oct 12, 2024 · 2 comments · Fixed by #760
Closed

Inline props does not properly support patterns #718

lukechu10 opened this issue Oct 12, 2024 · 2 comments · Fixed by #760
Assignees
Labels
A-macro Area: macros C-bug Category: bug, something isn't working good first issue Good for newcomers

Comments

@lukechu10
Copy link
Member

lukechu10 commented Oct 12, 2024

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 lukechu10 added C-bug Category: bug, something isn't working good first issue Good for newcomers A-macro Area: macros labels Oct 12, 2024
@KekmaTime
Copy link

@lukechu10 i can work on this

@lukechu10
Copy link
Member Author

@lukechu10 i can work on this

Great! Let's me know if you run into any issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-macro Area: macros C-bug Category: bug, something isn't working good first issue Good for newcomers
Projects
None yet
2 participants