Skip to content

Commit

Permalink
feat(react): add onClick event
Browse files Browse the repository at this point in the history
  • Loading branch information
budougumi0617 committed Sep 29, 2024
1 parent 3e513a3 commit 261f0c3
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion react/tic-tac-toe/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
import "./index.css";

function Square({ value }: { value: string }): JSX.Element {
return <button className="square">{value}</button>;
function handleClick() {
console.log("clicked");
}
return (
<button className="square" onClick={handleClick}>
{value}
</button>
);
}

export default function Board() {
Expand Down

0 comments on commit 261f0c3

Please sign in to comment.