3 Minutes With Kent
Use event.currentTarget rather than event.target most of the time
- Autor: Vários
- Narrador: Vários
- Editora: Podcast
- Duração: 0:02:56
- Mais informações
Informações:
Sinopse
Hey there friends so I've been doing some live streaming through discord a live stream at actually I'm on zoom and then I live stream it to YouTube and then we chat on Discord. It's a fun time if you haven't joined us then you should because it's a good time. So anyway yesterday I was live streaming and I made a discovery thanks to some of the folks who were hanging out with us in the live stream. So when you respond to a change event or on submit event for a form or something we're talking about react here or just vanilla JavaScript Dom APIs when youYour event handler that gets called is going to get called with an event object and that object is going to have a target and it's also going to have a current target. Well, I always thought that Target is pretty much what you want all the time and I just realized because I was moving some stuff over to TypeScript and that's what I've been live streaming is moving my epic react workshops to TypeScript. And I realized that when you do event.Target with TypeScript,