News for hackers. Stuff that matters.
Re:Transform SVG into React components by kuschku on Monday October 30, 2017 @10:30AM (#15585213)
You know you can use CSS and JS for that?
Re:Transform SVG into React components by bromuro on Monday October 30, 2017 @04:23PM (#15588542)
> You know you can use CSS and JS for that?

No, I didn't. Thanks. /s

There are many cases it's more convenient updating SVG using React.

Re:Transform SVG into React components by kuschku on Monday October 30, 2017 @07:42PM (#15590004)
Of course it is more convenient, but it's also several orders of magnitude slower.

If you try rendering, say, maps with SVG, this becomes a significant issue.

Re:Transform SVG into React components by rmetzler on Monday October 30, 2017 @01:24PM (#15586962)
How would I go to represent rectangles, circles, text and lines with CSS and JavaScript? With Canvas? Is React able to render to canvas?

Sometimes SVG is a good fit for the graphics needed.

Re:Transform SVG into React components by kuschku on Monday October 30, 2017 @01:59PM (#15587317)
I meant styling the SVG — instead of replacing SVG with react (slow), use CSS to modify properties of the SVG DOM.

That is significantly faster.