And you could even make it into a curried function and keep it pretty similar to a regular hook:
Not useful in this case, yes we can suppress TS warning but It will not be a good idea.
React Hook useEffect cannot be called inside a callback. React Hooks must be called in a React function component or a custom React Hook function.
React Hook useDebouncedEffect cannot be called at the top level. React Hooks must be called in a React function component or a custom React Hook function.
The linter doesn't know how are you using your code so it gives you those warnings, if you use it as I said (first call of the curried version outside the component, second inside) it works exactly the same as a regular hook. Linters are there to help, but they aren't silver bullets, you have to understand the reason for the warnings and errors you get.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Not useful in this case, yes we can suppress TS warning but It will not be a good idea.
The linter doesn't know how are you using your code so it gives you those warnings, if you use it as I said (first call of the curried version outside the component, second inside) it works exactly the same as a regular hook. Linters are there to help, but they aren't silver bullets, you have to understand the reason for the warnings and errors you get.