Closed theKashey closed 6 years ago
Hey @theKashey! I don't really use or know TypeScript myself, so I'd ask that instead the definitions be contributed to DefinitelyTyped (or whatever the best practice is) so that others can maintain them independently of this library, since I won't know how to update them. But that would be awesome to have!
That's an open question - I personally prefer to have d.ts as a part of a library, as long it's much easier to synchronize API changes. Someone prefers them in DefinitelyTyped, but it is much harder to maintain them, as long it becomes "two dimensional".
The best practice - have a d.ts here, and have a simple "smoke" test also here.
Anyway - for all the time I've used react-powerplug without types - I always (~twice a day) mess with render props. Like
<Value> {(value, setValue)}
//not
<Value> {({value, setValue})}
This sort of mistake is hard to spot, but easy to type.
RenderProps and Types shall come together.
(could you assign this issue to me?)
For my take on this, after trying to work with the times from #25 myself, please see: https://github.com/ianstormtaylor/react-values/pull/25#issuecomment-412176112
Any plans to add
d.ts
, or happy if someone else will create it?