Skip to content

Commit 4bbe294

Browse files
committed
click events
1 parent c21697c commit 4bbe294

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
import React from 'react';
22

33
function Button() {
4-
const eventHandle = () => {
5-
console.log('ouch');
4+
const handlClick = (e) => {
5+
return (e.target.textContent = 'Ouch😒');
66
};
7-
return <button onClick={eventHandle}>click me 😊</button>;
7+
8+
return <button onClick={(e) => handlClick(e)}>click me 😊</button>;
89
}
910

1011
export default Button;

0 commit comments

Comments
 (0)