Skip to content

Instantly share code, notes, and snippets.

@greaveselliott
Created June 23, 2019 00:57
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 greaveselliott/76d81c534cc9093745c85c4d155018ff to your computer and use it in GitHub Desktop.
Save greaveselliott/76d81c534cc9093745c85c4d155018ff to your computer and use it in GitHub Desktop.
const onFormSubmit = event => {
event.preventDefault();
const listItemValue = input.current.value;
if (listItemValue !== "") {
createNewListItem({
dispatch,
payload: { listItemValue }
});
input.current.value = "";
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment