Merge pull request #906 from jussiry/patch-1

react todo example: fixes input clear on submit
This commit is contained in:
Mark Nadal 2020-04-06 21:35:06 -07:00 committed by GitHub
commit 2f34d8cb4e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -26,7 +26,7 @@
<form onSubmit={e => {
e.preventDefault();
gun.get("todos").set({ title: newTodo.current.value });
ref.current.value = ''
newTodo.current.value = ''
}}>
<input ref={newTodo} placeholder="new todo"/>
</form>