Snap.svg icon indicating copy to clipboard operation
Snap.svg copied to clipboard

How do I use Snap loading svg in react?

Open pxim opened this issue 6 years ago • 2 comments

Can i use Snap loading svg file in react like this? it's alse have svg dom.

<SVG src={'svg/s2.svg'} innerRef= {svg => {this.svgObj = svg;}} onLoad={()=>{this.initSVG(this.svgObj);}}/>

pxim avatar Nov 13 '19 05:11 pxim

I just found (and am using) an excellent app to convert your Svg into a React component. https://github.com/smooth-code/svgr

Let us know how you get on, if you end up using it.. On Wednesday, November 13, 2019, 5:46:19 AM GMT, Peng Xiang [email protected] wrote:

Can i use Snap loading in react like this?

<SVG src={'svg/s2.svg'} innerRef= {svg => {this.svgObj = svg;}} onLoad={()=>{this.initSVG(this.svgObj);}}/>

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.

chasbeen avatar Nov 13 '19 07:11 chasbeen

an

Thanks very much,

pxim avatar Nov 14 '19 07:11 pxim