react-final-form-hooks icon indicating copy to clipboard operation
react-final-form-hooks copied to clipboard

Types

Open erikras opened this issue 5 years ago • 1 comments

This library was conceived before the TS and Flow teams had formalized how to type hooks. I still have not looked into it, but if someone knows how, it would be great to get some typing while the library is still so tiny.

I wouldn't even object to a strong TS lover converting the library itself to TS, ideally with Flow types also exported.

Thanks in advance. 🙏

erikras avatar Mar 04 '19 20:03 erikras

@erikras I have already migrated your code to a very type safe version. of course I have trimmed some of the functionalities I didn't need. But they can be added easily. I wanted to share this and get other type lovers opinion on it.

https://gist.github.com/alitaheri/32ac56575045d6e498008f73e231fccd

I've also solved the issue with callbacks not being cached. take a look and give me your opinion on it. If it's acceptable I can make a PR.

alitaheri avatar Jun 18 '19 19:06 alitaheri