-
-
Save codebucks27/5271735a3afde89edb2b2f146760a923 to your computer and use it in GitHub Desktop.
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 React, { useState } from "react"; | |
const Todos = (props) => { | |
const [todo, setTodo] = useState(""); | |
const handleChange = (e) => { | |
setTodo(e.target.value); | |
}; | |
return ( | |
<div className="addTodos"> | |
<input | |
type="text" | |
onChange={(e) => handleChange(e)} | |
className="todo-input" | |
value={todo} | |
/> | |
<button className="add-btn"> | |
Add | |
</button> | |
<br /> | |
</div> | |
); | |
}; | |
export default Todos; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment