Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@paularmstrong
Last active October 13, 2020 15:54
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save paularmstrong/8c989509bc6cdf76eb61dfc97259fab0 to your computer and use it in GitHub Desktop.
Save paularmstrong/8c989509bc6cdf76eb61dfc97259fab0 to your computer and use it in GitHub Desktop.
const HeartIcon = (props = {}) => (
<svg {...props} viewBox='0 0 ${width} ${height}'>
<g><path d='M38.723 12c-7.187 0-11.16 7.306-11.723 8.131C26.437 19.306 22.504 12 15.277 12 8.791 12 3.533 18.163 3.533 24.647 3.533 39.964 21.891 55.907 27 56c5.109-.093 23.467-16.036 23.467-31.353C50.467 18.163 45.209 12 38.723 12z'></path></g>
</svg>
);
@styfle
Copy link

styfle commented Apr 14, 2017

Where are width and height defined? I would expect to see props.width and props.height in the template string.

@marvinrichter
Copy link

It's done with ES6 spread operator {...props}

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