Skip to content

Commit 7de8f80

Browse files
committed
finish
1 parent 9b6e47c commit 7de8f80

File tree

1 file changed

+17
-5
lines changed

1 file changed

+17
-5
lines changed

src/App.js

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,27 @@
11
import React from 'react';
22

33
const App = () => {
4-
const handleClick = () => console.log('Clicked!');
5-
64
return (
75
<div>
8-
<button type="button" onClick={handleClick}>
9-
Click me!
10-
</button>
6+
<Button handleClick={() => console.log('Clicked button One!')}>
7+
Click Button One!
8+
</Button>
9+
<Button
10+
type="submit"
11+
handleClick={() => console.log('Clicked button Two!')}
12+
>
13+
Click Button Two!
14+
</Button>
1115
</div>
1216
);
1317
};
1418

19+
const Button = ({ type = 'button', handleClick, children }) => {
20+
return (
21+
<button type={type} onClick={handleClick}>
22+
{children}
23+
</button>
24+
);
25+
};
26+
1527
export default App;

0 commit comments

Comments
 (0)