Skip to content

Instantly share code, notes, and snippets.

@codebucks27
Last active April 22, 2021 08:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save codebucks27/5271735a3afde89edb2b2f146760a923 to your computer and use it in GitHub Desktop.
Save codebucks27/5271735a3afde89edb2b2f146760a923 to your computer and use it in GitHub Desktop.
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