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

Support shorthand <div {property} /> syntax #650

Open
farism opened this issue Sep 4, 2023 · 0 comments
Open

Support shorthand <div {property} /> syntax #650

farism opened this issue Sep 4, 2023 · 0 comments
Labels

Comments

@farism
Copy link
Contributor

farism commented Sep 4, 2023

In Mint, to pass a bunch of property variables to a component, you have to list out the key/value for each one.

component Main {
  fun render : Html {
    let disabled =
      false

    let onClick =
      (e : Html.Event) { "" }

    <button
      disabled={disabled}
      onClick={onClick}/>
  }
}

This can get cumbersome and noisy when you have many props.

It would be nice if Mint had the ability to do shorthand properties (like in Svelte)

component Main {
  fun render : Html {
    let disabled =
      false

    let onClick =
      (e : Html.Event) { "" }

    <button {disabled} {onClick} />
  }
}
@Sija Sija added language Language feature feature request labels Sep 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants