Skip to content

ES6 Spread Syntax

Compare
Choose a tag to compare
@mficzel mficzel released this 30 Nov 10:47
· 103 commits to master since this release

To apply multiple properties to a fusion prototype with a single expression afx supports the spread syntax from ES6:

<Vendor.Site:Component {...expression} />

Is transpiled as:

Vendor.Site:Component {
    @apply.spread_1 = ${expression}
}

Spreads can be combined with props and the order of the definition is of props and spreads is preserved, spreads will override previously defined props but are overwritten again by later props.

Note: Spreads rely on the @apply feature of Neos.Fusion 4.2 so this version of Neos is required.