Skip to content

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

@farism

Description

@farism

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions