https://github.com/rodentman87/react-svg-dedupe
SVG De-duplicator for React!
https://github.com/rodentman87/react-svg-dedupe
Last synced: about 1 year ago
JSON representation
SVG De-duplicator for React!
- Host: GitHub
- URL: https://github.com/rodentman87/react-svg-dedupe
- Owner: Rodentman87
- Created: 2023-03-11T06:03:35.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-03-11T06:09:20.000Z (about 3 years ago)
- Last Synced: 2025-02-01T15:45:02.314Z (over 1 year ago)
- Language: TypeScript
- Size: 6.84 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Deduped SVG
Deduped SVG moves svgs out of the normal flow of the document and instead places it in a single location and renders a reference to it in place. To use the library, simply add a `DedupedSVGRenderer` at the top level of your app as the _very_ last thing rendered, and then render the deduped svgs like this:
```tsx
{/* inside */}
```
All instances of DedupedSVG with the same `id` will instead be replaced with a reference to the single SVG being rendered.