Skip to content

Instantly share code, notes, and snippets.

@anilgulecha
Created February 7, 2026 07:12
Show Gist options
  • Select an option

  • Save anilgulecha/e6d61c174eb3b630161c6457a833dc2f to your computer and use it in GitHub Desktop.

Select an option

Save anilgulecha/e6d61c174eb3b630161c6457a833dc2f to your computer and use it in GitHub Desktop.
Untitled Project
import { useState } from "react";
function Counter(props) {
const [count, setCount] = useState(0);
return (
<div className="container">
<h1>Hello, {props.name}!</h1>
<img className="logo" alt="logo" src="https://livecodes.io/livecodes/assets/templates/react.svg" />
<p>You clicked {count} times.</p>
<button onClick={() => setCount(count + 1)}>Click me</button>
</div>
);
}
export default function App() {
return <Counter name="React" />;
}
.container,
.container button {
text-align: center;
font: 1em sans-serif;
}
.logo {
width: 150px;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment