working with svg image received from server as data
See original GitHub issueMy react app is receiving svg as response from an API call and it is currently rendered using below syntax
<span dangerouslySetInnerHTML={{__html: this.state.data.image}} />
I want to add pan-zoom features but not sure how to do it with this library. Could you please allow passing image data as props to this component or suggest any workarounds.
-thnx
Issue Analytics
- State:
- Created 6 years ago
- Comments:8 (5 by maintainers)
Top Results From Across the Web
load an svg from server and show it into an html element
I know it can show using <img> tag,but i need to write some events on the svg elements. $.get( "http://example.com/_assets/img/gptest.svg", ...
Read more >Serve SVG with the Correct Content Type - CSS-Tricks
If you are trying to use SVG like <img src="image.svg"> or as a CSS background-image , and the file is linked to correctly...
Read more >How to Use SVG Images in CSS and HTML – A Tutorial for ...
To do this, open the SVG image in VS code or your preferred IDE, copy the code, and paste it inside the <body>...
Read more >The Best Way to Embed SVG on HTML (2021) - Vecta.io
When we embed an image onto HTML, it's always good to have alt and title attributes, for better accessibility. An alt attribute allows...
Read more >Love Generating SVG With JavaScript? Move It To The Server!
The easiest way to put the generated SVG on the server is just to send the generated data with an AJAX request when...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
This works. Thanks a lot !
hi @KristianLonergan - I think we ended up not using the miniature feature at that point. That said, we were testing then with an older version of v2. Seems to be working now in another project where we are using this feature with v3. But we are not using
dangerouslySetInnerHTML
.