I find myself struggling to remember the quirks when defining a module interface for a React component especially when there are optional types. This has become somewhat required when working with a framework like NextJS where hot-reloading breaks if the react component isn’t the the sole export of the module.
My current workflow is to copy the component type signature provided by the tooltip from the rescript extension and then carefully massaging it into a type that works while remember things like: order of the named parameters suddenly becomes important, optional types that would be typed one way in the definition are typed differently in the interface etc.
I’m curious if I’m missing a simpler way to accomplish this.
Nothing concrete planned yet, but it’s definitively on our radar to improve the editor tooling around working with interface files/interfaces in general. Lots to be done, and some fairly low hanging fruit.
Slightly off topic, but here’s an old experiment we did in the editor tooling that’s a bit related: