Skip to content
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

useDebounce: Incorrectly used 'any' type #5071

Closed
Vilican opened this issue Oct 10, 2023 · 1 comment · Fixed by #5072
Closed

useDebounce: Incorrectly used 'any' type #5071

Vilican opened this issue Oct 10, 2023 · 1 comment · Fixed by #5072
Assignees
Labels
Typescript Issue or pull request is *only* related to TypeScript definition
Milestone

Comments

@Vilican
Copy link
Contributor

Vilican commented Oct 10, 2023

Describe the bug

useDebounce is typed only with any values, which causes problems with using it in TypeScript

image

Reproducer

https://codesandbox.io/s/primereact-test-forked-hwkg8m?file=/src/index.js

PrimeReact version

10.0.2

React version

18.x

Language

TypeScript

Build / Runtime

Vite

Browser(s)

No response

Steps to reproduce the behavior

No response

Expected behavior

Should be typed with TS generics, similarly to native useState

@Vilican Vilican added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Oct 10, 2023
@Vilican Vilican changed the title Replace_With_Component_Name: Brief_Bug_Description useDebounce: Incorrectly used 'any' type Oct 10, 2023
@melloware 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 Oct 10, 2023
@melloware melloware added this to the 10.0.3 milestone Oct 10, 2023
@melloware
Copy link
Member

PR would be welcome

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Typescript Issue or pull request is *only* related to TypeScript definition
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants