Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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.

Loading

@marvinrichter
Copy link

marvinrichter commented Apr 18, 2017

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

Loading

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