Open endoval opened 3 months ago
That's a very good question, thank you for raising this up! Indeed this seems to indicate we will run into issues when extending this feature to inputs. Your suggestion seems valid to me. @djhi @fzaninotto wdyt?
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 next
branch. Thanks for offering to work on this :slightly_smiling_face:
I'm -1 for adding a dependency to react-hook-form
on non-form elements. Instead, we have two options:
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: https://github.com/marmelab/react-admin/pull/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! :)