anup-a/svgwave

Export JSX version of svgs (waves)

quick007 opened this issue · 7 comments

Hi can you please add a "copy jsx" button ty!

@quick007 sure great idea. will put it up in the roadmap.

Description - Right now, we support svgs and png as export option. Request is to also support the jsx version of svgs.

@anup-a Hey, I am looking into this issue, am i allowed to add a external npm package?

@dexterpuru hi sure. you can use npm package if it takes minimal space & effort. But I'll recommend you to just export the wave component (which we use in preview) as string. Let me know if there is any issue/ques with this approach.

@anup-a I see that you pass the ref of whole svg tag to "Export SVG Code" component, I think converting some svg to jsx needs some parsing, i found a pkg that does the parsing, React-SVGR, check its bundle size also , let me know if i can go forward with this.

If you want to do it the budget way, you could just replace all the class= to className=
That doesn't fix the gradient issue- nevermind.

@dexterpuru Sorry forgot to reply to your comment.

React-svgr looks quite bulky to add in this project, I will put some time to find a better solution. Thanks