A project created by Anil Gulecha on LiveCodes.
Created
February 7, 2026 07:12
-
-
Save anilgulecha/e6d61c174eb3b630161c6457a833dc2f to your computer and use it in GitHub Desktop.
Untitled Project
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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" />; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| .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