Writing a Custom Hook: Conditional Hooks

Опубликовано: 01 Март 2026
на канале: Harry Wolff
4,890
161

This is a continuation of my last video where we started writing our own custom React Hook, useEventListener:    • Writing a Custom Hook: useEventListener  

In this video we're going to extend the functionality of that Hook adding something I find myself needing more than I realized: Conditional Hooks!

But how?! Have a watch and find out!

Source code: https://github.com/hswolff/youtube/bl...

Part 1, Writing the Hook:    • Writing a Custom Hook: useEventListener  
Part 3: Using TypeScript:    • Writing a Custom React Hook with TypeScript  

——

NEWSLETTER: https://tinyletter.com/hswolff/subscribe

PATREON:   / hswolff  

TWITTER:   / hswolff  

SITE: https://hswolff.com/