mint icon indicating copy to clipboard operation
mint copied to clipboard

Support shorthand `<div {property} />` syntax

Open farism opened this issue 2 years ago • 0 comments

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} />
  }
}

farism avatar Sep 04 '23 13:09 farism