Marius Balaj

Doomstadt Software Developer Joined over 8 years ago

  • 3 stories
  • 1 comment
  • Posted to SVG to JSX - Convert SVG to React valid SVG, in reply to Alessandro Stigliani , May 02, 2017

    Hey Alessandro,

    Besides the stuff Simon already explained it also converts the inline style to attributes or it converts to Javascript objects.

    Basically <svg style='fill:red;margin-left:20px;'.. will throw an error in React, but using this tool the output will be like this <svg fill='#f00' style={{marginLeft: 20}}.. which is valid JSX code.

    You will find this tool usefull mostly when working with SVG sprites in React.

    0 points
Load more comments