xnimorz/use-debounce

Not react hook?

Closed this issue · 1 comments

React Hook "useDebouncedCallback" is called in function "handleReactPost" that is neither a React function component nor a custom React Hook function. React component names must start with an uppercase letter. React Hook names must start with the word "use".

Hey @gnortpro
I you want to use the use-debounce hook inside a function, like in your example: handleReactPost it should be defined as a custom hook, otherwise, you can use lodash.debounce.

Cursom react hook: https://react.dev/learn/reusing-logic-with-custom-hooks
lodash debounce: https://lodash.com/docs/#debounce