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

Why does ReScript React use labeled arguments instead of props?

$
0
0

I just saw this in the ReScript React docs. What are the reasons for this choice ? Record types seem easier to work with, can use the spread syntax, facilitate HOC and are the common way to work in React. And why is @react.component needed?

Can anyone explain?

In ReactJS, props are usually described as a single props record. In ReScript, we use labeled arguments to define our props parameters instead.


Viewing all articles
Browse latest Browse all 2592

Trending Articles