-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Define prop types for HTML elements e.g. <input> #7644
Comments
@goodmind Is there an update on this? |
This is one of the bigger issues that we are facing daily. |
Any workaround at least? what are we supposed to use useRef for if we can target dom node elements? |
does anyone remember this issue? |
As a temporary (or not so temporary) solution, there's now Flow Typed envs (here the |
So there's no TS equivalent of |
Typing these HTML intrinsics is on our TODO list - we've had internal requests for this as well |
I want to be able to describe a component, let's call it
CustomInput
, which just wraps an HTML<input>
, providing it with some pre-set attribute values.I'd like to say that the
Props
ofCustomInput
are the set of props expected by the DOM's<input>
, plus a couple custom values.Currently either this isn't possible, or I've missed the docs after reading through Flow docs.
I would expect something like this would be possible:
The error flow (0.90) gives is:
Missing/Incorrect APIs
DOM
For example,
<input>
class is defined here:flow/lib/dom.js
Line 3239 in 422f13b
Relevant documentation
If there's a way to do the above using just the
HTMLInputElement
that'd be great, but otherwise perhaps DOM.js could include the props as their own type? For comparison/info, that appears to be what is available in TypeScript:https://github.com/DefinitelyTyped/DefinitelyTyped/blob/d8748201c7bfc38d70269af3bcaa3a5c380547af/types/react/index.d.ts#L1943
There's also an unanswered question about how to do this on Stack Overflow.
The text was updated successfully, but these errors were encountered: