4 ms·
> what percentage of React users are making interactive SVGs Every single app I worked on for the past 5 years did. `mui` icons are SVG for example, and it's c
by fathyb 3y ago
> what percentage of React users are making interactive SVGs
Every single app I worked on for the past 5 years did. `mui` icons are SVG for example, and it's common practice to embed SVG as components to avoid the HTTP requests overhead and allow for theming through props.
- josephg 3y agoMost people who embed svgs aren’t looking to make them interactive though. I think I’ve attached event handlers to internal elements in an svg maybe once in my entire career.
- pcthrowaway 3y agoThings like the sparkline charts on npmjs (e.g. https://www.npmjs.com/package/npm https://www.npmjs.com/package/npm ) are interactive SVGs. I think they're pretty common for data visualizations of all kinds
- afavour 3y agoThat’s not what I’m talking about though: those aren’t interactive. You could dangerouslySetInnerHTML with them (arguably you should, it’s a waste of VDOM otherwise) and they’d be just fine.
- deleted 3y ago[deleted]