DEV Community

Jenny Phan
Jenny Phan

Posted on

Help with React Hooks and event handlers

I'm quite new to React so bare with me:) I recently started using React hooks and I realized that you cannot use hooks within event handlers. This is a little confusing to me but maybe I am not understanding something. I am able to use useSetState hook within an event handler with no issues, so this confuses me. One issue my team is facing is this - how to call a hook when an event is being fired in a class that isn’t even in your react code?

Top comments (0)