Skip to content

Instantly share code, notes, and snippets.

@luistak
Created January 27, 2021 15:45
Show Gist options
  • Save luistak/af340c6d605a391b282c92b29b9d3963 to your computer and use it in GitHub Desktop.
Save luistak/af340c6d605a391b282c92b29b9d3963 to your computer and use it in GitHub Desktop.
function App({ onNewMessage }) {
const handleSubmit = (e) => {
e.preventDefault();
const { target: form } = e;
const input = form?.elements?.something;
onNewMessage(input.value);
form.reset();
}
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment