bram209 / leptosfmt

A formatter for the leptos view! macro
Apache License 2.0
272 stars 29 forks source link

Destructuring `let` attribute in `<For>` component is removed #148

Closed bicarlsen closed 1 month ago

bicarlsen commented 1 month ago

As mentioned in leptos Issue 3509, the let attribute of a <For> component can be destructured with the let(/* pattern */) syntax, however leptosfmt completely removes this. i.e.

<For
  each=move || list.get()
  key=|Item { name, .. }| name.clone()
  let(Item { name, value })  // this will be stripped
>

is formatted to

<For
  each=move || list.get()
  key=|Item { name, .. }| name.clone()
  let  // destructured pattern is stripped
>