-
-
Save fdjones/5047d07cc88eb9357f1cd6c0f426a113 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
const AddTodo: React.FC = (): React.ReactElement => { | |
const [userInput, setUserInput] = React.useState(""); | |
const dispatch = useDispatch(); | |
const handleAddTodo = (e: React.ChangeEvent<HTMLInputElement>) => { | |
if (e.key === "Enter") { // Property 'key' does not exist on type 'ChangeEvent<HTMLInputElement>'.ts(2339) | |
dispatch(add({ id: uuidv4(), task: "bob" })); | |
} | |
}; | |
return ( | |
<div> | |
<label htmlFor="add-todo"> | |
Add todo: | |
<input type="text" name="add-todo" id="add-todo" /> | |
</label> | |
</div> | |
); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment