Created
July 27, 2022 14:33
-
-
Save Ishan-pro/f584ef5f0b7726b6b8f3eda7e085051f to your computer and use it in GitHub Desktop.
Dev.to Blog Post React Tutorial For beginners - Part 2 -> Getting reactive challenge
This file contains 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 "./styles.css"; | |
import React, {useState} from 'react' | |
export default function App() { | |
const [name, setName] = useState(' ') | |
const handleChange = (e) => { | |
setName(e.target.value) | |
} | |
return ( | |
<div className="App"> | |
<h1> | |
{ | |
`Hello ${name}` | |
} | |
</h1> | |
<input value={name} onChange={handleChange}/> | |
</div> | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment