Skip to content
This repository was archived by the owner on Jul 19, 2025. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions react-foundations/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,20 @@
return (<h1>{title? title : 'Default Title'}</h1>);
}





function HomePage() {
const names = ['Ada Lovelace', 'Grace Hopper', 'Margaret Hamilton'];

const [likes, setLikes] = React.useState(0);

function handleClick(){
console.log("increment like count")
setLikes(likes + 1);
}

return (
<div>
<Header title="Develop. Preview. Ship." />
Expand All @@ -24,6 +35,7 @@
<li key={name}>{name}</li>
))}
</ul>
<button onClick={handleClick}>Like({likes})</button>
</div>
);
}
Expand Down