Comments (6)
@Bartozzz this issue should be fixed if you want to try grabbing the latest version now.
from react-svg.
@Bartozzz that looks like expected behaviour to me?
In your example screenshot, I can see the icon
class is showing up on the svg
element. If you sent through icon is-active
as the value for the className
prop (say, when that render
function was called again), then those two classes will show up on the svg
element.
from react-svg.
Yes, the .icon
class shows on the svg
element on the first render, but it's keeps showing on the consecutives ones - even if themeIcon
has changed. Maybe it happens only on my machine as I am using NW.js
and the Node.js
/Window
context is messed up a little. At this moment I am adding the .is-active
class to the parent element.
Anyway, can you provide a working, tested example that's adds a class to the ReactSVG
element?
from react-svg.
I see what you mean now. This module delegates to SVGInjector
, and I think that keeps an internal cache of the SVG's it loads, and if it determines an SVG has already been loaded, then it won't update it. I'd need to investigate further.
In the meantime it sounds like your workaround will be ok, I'm guessing (have yet to test this) you're doing something like wrapping ReactSVG
in a div
, and getting at the SVG element via a selector like .icon.is-active svg {}
?
from react-svg.
Yup, that's exactly what I am doing.
from react-svg.
Closing, assuming the thumbs up meant things were all good? Feel free to post a new issue or reopen this one if you feel the issue isn't resolved.
from react-svg.
Related Issues (20)
- Components don't work properly in iframe
- Components don't work properly in iframe HOT 4
- <style>-tag inside SVG becomes a page-wide style HOT 2
- Setting color HOT 3
- src prop warning in unit testing react testing library HOT 2
- Re-render of react-svg lost reference HOT 2
- ref type is incompatible HOT 2
- React SVG isn't working, when we give the external source. HOT 2
- wrapper rendered twice HOT 2
- Unit test cases are failing, if i use ReactSVG. HOT 4
- Namespace 'React' has no exported member 'JSX'. HOT 3
- Styling in scss HOT 2
- Doesn't update <use /> tag "href" attribute when `renumerateIRIElements` is true HOT 2
- CORS issue HOT 4
- SVG URL EXTERNAL, How Can I mock!? HOT 2
- ForwardedRef not assignable to ref type
- Make wrapper optional HOT 1
- 'ReactSVG' cannot be used as a JSX component.
- react-svg ssr compatibility with nextJs v14 App router
- A11y | <title> doesn't make an svg screen reader friendly
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-svg.