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

Feature Request: Renaming JSX components

$
0
0

Hey,

JSX components are defined by using a make function, labeled arguments and optional a @jsx.component decorator.

The way I work with components (also in TypeScript) is by defining a props record and refer to theses props explicitly. Example:

type props = { name: string }

let make = props => {
  Console.log(props.name)
  // ...
}

I don’t know why I like it more this way. I don’t get used to labeled arguments.
Unfortunately it doesn’t work with the decorator and props record. So the generated JS code will produce a lot of make functions. It’s not that bad - mostly I don’t care - but it would be nice, if the decorator will also work with records.

Are there any reasons against this feature?


Viewing all articles
Browse latest Browse all 1784

Trending Articles