Learn React Click Events 👆
ฝัง
- เผยแพร่เมื่อ 5 ส.ค. 2024
- 00:00:00 intro
00:00:15 Button component
00:01:17 onClick attribute
00:02:18 onClick with parameters
00:03:49 onClick + conditions
00:05:50 events
00:08:02 onDoubleClick
00:08:28 ProfilePicture component
00:11:06 Hide an image on click
00:11:58 conclusion
function Button(){
const handleClick = (e) => e.target.textContent = "OUCH! 🤕";
return( handleClick(e)}>Click me 😀);
}
export default Button
function ProfilePicture(){
const imageUrl = './src/assets/profile.jpg';
const handleClick = (e) => e.target.style.display = "none";
return( handleClick(e)} src={imageUrl}>);
}
export default ProfilePicture
import Button from './Button.jsx'
import ProfilePicture from './ProfilePicture.jsx'
function App() {
return(
);
}
export default App
Do react native videos as well
I am learning react this month and ur videos make it very easy to understand. I am currently trying to become a pro at use state
THANK YOU SO MUCH FOR THE REACT CONTENT! 😊
Hey Bro Code love your videos, brother! 🙌 Hoping to see more awesome content on React. Keep up the great work! 👍
Best teacher on the planet. since I started coding no one teaches me better fr
Thank you Bro, this lesson is great! Could you please continue making React.js lessons?
Ty for your effort and time. More react content and maybe with ts or helping how to migrate to ts would be beneficial.
Very effective lesson
Thanks,mate❤
Bro stop clicking me. 🤣
Sounds exciting
Thank bro .
thanks you so much
Thanks ❤
thank You
Nice tutorial. Just a note {handleClick} === {(e) => handleClick(e)} there is no need to wrap the callback in this case.
Hi my bro, could you please upload more videos on react I love your way of explaining and I have exam ln it soon
Noice ❤
Hellou brou🙌 i am stevan from indonesia, i am sorry for stoped stream Earlier 🙏🏻
Finally dude
Is there a reason why you decided to start your file path to your image with "src" instead of just going directly to the folder ./assets/profile.jpg ?
because it is straight forward. Even if you put ProfilePIcture.jsx file somewhere else, you won't have to change the path.
Also, the path might be '/src/assests/profile.jpg' with the dot (.) at the beginning.
Sidenotes: If you are moving files within VS Code, it does automatically change the path for you though.
how to add emoji in react?
Django course please
Bro can u plz make a playlist for linux shell script
I cannot load background image in css in vs code .it is showing error help me
Put it in the public directory and access it as "/image-name"
what error could you elaborate?
What's the emoji extension?
windows key + .
Win + ;
perfect after gym while eating motherfucking eggs