getInputProps
should have optional options
#554
ivan-kleshnin
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Type-wise
getInputProps
requires to provide{type: "text" | "email | ...}
which is then passed to an input.Most libraries (including custom) have
TextInput
,EmailInput
, etc. components wrapping native HTML form elements and declaringtype=something
themselves. So the above requirement violates DRY and ends up like this:It should be possible to obtain the type from the element itself (like you do in other cases) deduplicating to:
This issue, IMO, is framework-agnostic. Or is it strictly necessary and unavoidable to know the type before the element is mounted?
Beta Was this translation helpful? Give feedback.
All reactions