-
-
Notifications
You must be signed in to change notification settings - Fork 5.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consider replacing "hotscript" types with "react-hook-form" types #9849
Comments
That's a very good question, thank you for raising this up! |
That would indeed be better and avoid an extra dependency! Thanks for the suggestion. |
Great, thanks for the positive response. Looking forward to this change! 😌🙏 |
Hi 👋, I would like to work on this issue. Can you assign this issue to me. |
@anmol-fzr No need to assign the issue, you can open a PR mentioning this issue right away and we will review it carefully. Please remember to target the |
I'm -1 for adding a dependency to
|
Hello there,
we stumbled upon the fact that your typing of source property on
*Field
components useshotscript
types like so:Call<Objects.AllPaths, Resource>
(added here: #8863)We were wondering why that is the case because you are afaik using
react-hook-form
underneath, which provides a nice type to check paths as well withFieldPath<Resource>
. Sadly, those two types require a different syntax for "array paths", which both functionally work. Consider the following example to illustrate this:Both versions work just fine (because the used
lodash/get
understands both), but of course the types are not matching. This might not seem like a problem right now, but once you start typing the*Input
components all the way down to react-hook-form'suseController()
(within youruseInput()
) the types will clash. This already happens in our code base with some custom-written Inputs that usereact-hook-form
directly.What we are wondering: Do you intend to stick to the
hotscript
types or consider switching toreact-hook-form
types?Thank you! :)
The text was updated successfully, but these errors were encountered: