This is a continuation of my last video where we started writing our own custom React Hook, useEventListener: https://morioh.com/p/dc2156924439
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/blob/master/videos/react-demos/src/demo/use-event-listener.js
Part 1, Writing the Hook: https://morioh.com/p/dc2156924439
Part 3: Using TypeScript: https://morioh.com/p/dabbf979f2bb
#react #javascript #developer