React is a Javascript library, and just like Vanilla JS, React can respond to many events. The most common of these events is probably the click event. This tutorial will give examples of the various ways implement and respond to click events in React. Just getting started with Javascript? If so, I suggest starting with my full 8 hour Javascript tutorial for beginners here: ua-cam.com/video/EfAl9bwzVZk/v-deo.html
Why does onClick={handleClick} omit the parentheses? If I include them, onClick={handleClick()}, it seems to execute the function immediately and only once on render. *Nvm, you answered it later in the video. Great lesson as always, thanks!*
Hi Dave. Do you handle in one of your videos, switching from Event bubbling to capturing in React? I would like to intercept an event from above. Question Two: Do u have a Patreon account :) ?
I don't have one for event bubbling & capturing in React, but I do have one for JavaScript - and React is a JS library: ua-cam.com/video/UVRDq-wnfgk/v-deo.html And thanks for asking about Patreon! I'm just starting one but it is not ready yet. I do have a BuyMeACoffee page: www.buymeacoffee.com/davegray
Not sure how react handles button click event but I always tend to add type="button" attribute to my buttons even if they are not inside a form element (just a habit), I know this is applicable for buttons inside a form only but it caused some troubles in the past to figure out why my page was reloading while I'm using xhr, after that I found that the default type for a button element is "submit" 🤦♂️ Nice video and looking forward to the next one,
Just as Jerry I also have a problem with the code, and I've been double checking it for typos. I don't get the $name function to work - (name) get's 'greyed out' and the console just show ${name} was clicked. The next thing is that I don't get the double click to work - I've tried a number of ways to get it to work. But I'm stuck. Any one that can help me out?
React is a Javascript library, and just like Vanilla JS, React can respond to many events. The most common of these events is probably the click event. This tutorial will give examples of the various ways implement and respond to click events in React. Just getting started with Javascript? If so, I suggest starting with my full 8 hour Javascript tutorial for beginners here: ua-cam.com/video/EfAl9bwzVZk/v-deo.html
you worth millions of subscribes, thank you
You're welcome! I appreciate your kind words. 🙏
An awesome explanation of events and references.
Thank you!
Thank you so much Dear Sir for this series ♥️ . Please make this series to advance level
You're welcome! Yes, starting at the beginning and working my way up! 🚀
@@DaveGrayTeachesCode♥️♥️ 😊♥️♥️
@@DaveGrayTeachesCode Don't forget to include Redux!
How did you read in my mind ? Exactly this question at the end :)
Love these videos ❤
Awesome!!
Thanks! 🙏💯
Super explanation
awesome as always :-)
Thanks again!
Thank u. i ended it!
Thanks 🙏🏻
You're welcome! 🙏
Why does onClick={handleClick} omit the parentheses? If I include them, onClick={handleClick()}, it seems to execute the function immediately and only once on render.
*Nvm, you answered it later in the video. Great lesson as always, thanks!*
Thanks for the comment and glad you found your answer! 💯🙏
Hi Dave. Do you handle in one of your videos, switching from Event bubbling to capturing in React? I would like to intercept an event from above. Question Two: Do u have a Patreon account :) ?
I don't have one for event bubbling & capturing in React, but I do have one for JavaScript - and React is a JS library: ua-cam.com/video/UVRDq-wnfgk/v-deo.html And thanks for asking about Patreon! I'm just starting one but it is not ready yet. I do have a BuyMeACoffee page: www.buymeacoffee.com/davegray
very useful. Is it a full course by react js?
Yes, this video is part of a playlist that is a full course.
Not sure how react handles button click event but I always tend to add type="button" attribute to my buttons even if they are not inside a form element (just a habit),
I know this is applicable for buttons inside a form only but it caused some troubles in the past to figure out why my page was reloading while I'm using xhr, after that I found that the default type for a button element is "submit" 🤦♂️
Nice video and looking forward to the next one,
That is an interesting consideration! Thank you for the comment Ahmad 🙏💯
@@DaveGrayTeachesCode Studying the tool before start using saves time,
All thanks back to you Dave!
Just as Jerry I also have a problem with the code, and I've been double checking it for typos. I don't get the $name function to work - (name) get's 'greyed out' and the console just show ${name} was clicked. The next thing is that I don't get the double click to work - I've tried a number of ways to get it to work. But I'm stuck. Any one that can help me out?
I solved the first problem with $name - but I can't get the doubleClick to work
How did he know that {name} is dave ? 4:50
Is the parameter. Sorry sir for my ignorance.
I have been having an issue... Onclick works.. But on doubleclick doesn't despite using the same logic as you... Getting frustrated here
More React :)
Always!
Top
dammn i love u
🗾🗾🗾🗾🥭🥭🍎🍊