dotnet-websharper / core

WebSharper - Full-stack, functional, reactive web apps and microservices in F# and C#
https://websharper.com
Apache License 2.0
593 stars 52 forks source link

Add the spread operator - Part I #1355

Closed granicz closed 10 months ago

granicz commented 10 months ago

Need the ability to use the spread operator in WebSharper output. This ticket is for the work involved in making the spread operator available in F# scenarios, such as interpolated JSX strings, WebSharper client-side code, etc.

Given that we can't use ... as a custom F# operator, one proposal is to use !..., as in:

let Foo props =
    let counter = 1
    JS.Verbatim $"""<span style={ {| fontSize="2rem" |} } {!... props}>{counter}</span>"""
granicz commented 10 months ago

Resolved in https://github.com/dotnet-websharper/core/commit/46c10a3d30026778bdc221e2bb520d88851f0c46