3 ms·
You know you can use CSS and JS for that?
by kuschku 9y ago
You know you can use CSS and JS for that?
- rmetzler 9y agoHow 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.
- kuschku 9y agoI meant styling the SVG — instead of replacing SVG with react (slow), use CSS to modify properties of the SVG DOM. That is significantly faster.
- bromuro 9y ago> 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.
- kuschku 9y agoOf 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.