Quantcast
Channel: ReScript Forum - Latest posts
Viewing all articles
Browse latest Browse all 1795

Why does ReScript React use labeled arguments instead of props?

$
0
0

Some guesses:

  • optional parameters (optional fields in records weren’t able a few versions ago)
  • performance (just pass parameters instead of creating objects, but probably the compiled code will be the same)

Btw.: if you create a make function with a props record as parameter, you don’t need @react.component or @jsx.component
I use it only for components without props.


Viewing all articles
Browse latest Browse all 1795

Trending Articles