Skip to content

Instantly share code, notes, and snippets.

@edmangimelli
Created April 19, 2019 05:37
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 edmangimelli/a6735357e7c8ca49903747f03d74228f to your computer and use it in GitHub Desktop.
Save edmangimelli/a6735357e7c8ca49903747f03d74228f to your computer and use it in GitHub Desktop.

can't stand typing target.value; love type ellipses?

const Input = props => {
  const onChange = props.onChange && (({target}) => props.onChange(target.value));
  return <input {...{...props, ...onChange && {onChange}}} />;
}

:troll_face:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment