rescript-association/genType

Use genType to compile component as React.FunctionComponent in Typescript.

lbonanni opened this issue · 3 comments

Currently, when we compile a [@react.component] to Typescript, it generates a React.ComponentType.
I'm not familiar with genType's configuration, but is it possible to generate a React.FunctionComponent instead ?

We are currently using the addon-docs storybook addon to display our components. But it seems it can't find the component types when using React.ComponentType (works fine with React.FunctionComponent).

Thanks for your feedback :)

In fact, this could be set somehow in the config no ?

Tried before, but still have not found a way to use FunctionComponent without some issue popping up somewhere, either with importing components from JS, or with components requiring conversion.

See e.g. https://github.com/reason-association/genType/blob/master/Changes.md#2330

No problem, thanks @cristianoc ! I'll find another way to manage that with storybook :)