-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
InputTextarea/InputText: Typescript incompatible ref type #3635
Labels
Typescript
Issue or pull request is *only* related to TypeScript definition
Milestone
Comments
mikejav
added
the
Status: Needs Triage
Issue will be reviewed by Core Team and a relevant label will be added as soon as possible
label
Nov 14, 2022
Related issue: #3172 |
melloware
added
Typescript
Issue or pull request is *only* related to TypeScript definition
and removed
Status: Needs Triage
Issue will be reviewed by Core Team and a relevant label will be added as soon as possible
labels
Nov 14, 2022
I am not a typescript expert but here is how its currently being extended. export interface InputTextareaProps
extends Omit<React.DetailedHTMLProps<React.TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, 'ref'> |
The following should work: export declare const InputTextarea: React.ForwardRefExoticComponent<InputTextareaProps & RefAttributes<HTMLTextAreaElement>>; |
melloware
changed the title
InputTextarea: Typescript incompatible ref type
InputTextarea/InputText: Typescript incompatible ref type
Nov 14, 2022
This is fantastic! Trying it now it seems to work so fixing InputText as well. |
melloware
added a commit
to melloware/primereact
that referenced
this issue
Nov 14, 2022
OK this is now causing other issue it hthe TypeScript checking...
|
melloware
added a commit
to melloware/primereact
that referenced
this issue
Nov 14, 2022
melloware
added a commit
that referenced
this issue
Nov 14, 2022
@mikejav thanks for the assist on this! this has been driving me nuts for a while now... |
@melloware no problem :) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
When you are using
InputTextarea
component and want to access the DOM Element using the reference - it indicates the wrong type.Expected behavior
The
HTMLTextAreaElement
type should be used for ref.Reproducer
https://stackblitz.com/edit/vitejs-vite-6zkqc4?file=package.json,src%2FApp.tsx
PrimeReact version
8.7.2
React version
18.x
Language
TypeScript
Build / Runtime
Vite
Browser(s)
Chrome 106
The text was updated successfully, but these errors were encountered: