Skip to content

yew-macro: Allow omitting redundant property names #769

@Follpvosten

Description

@Follpvosten

Description

I'm submitting a feature request:

Going along with #745, this would be a very nice usability improvement (as also mentioned in #756).

For example, this:

let placeholder = if something { "Something" } else { "Something else" };
let maxlength = if blah { 7 } else { 10 };
html! {
    <input type="text" /* ... */ placeholder=placeholder maxlength=maxlength />
}

Could be written like this:

let placeholder = if something { "Something" } else { "Something else" };
let maxlength = if blah { 7 } else { 10 };
html! {
    <input type="text" /* ... */ placeholder maxlength />
}

This is getting rid of a lot of redundance in the long run by allowing the developer to omit the =property when a variable with the property's name is in scope.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions