Git Product home page Git Product logo

Comments (6)

tanem avatar tanem commented on August 18, 2024 1

@Bartozzz this issue should be fixed if you want to try grabbing the latest version now.

from react-svg.

tanem avatar tanem commented on August 18, 2024

@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.

Bartozzz avatar Bartozzz commented on August 18, 2024

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.

tanem avatar tanem commented on August 18, 2024

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.

Bartozzz avatar Bartozzz commented on August 18, 2024

Yup, that's exactly what I am doing.

from react-svg.

tanem avatar tanem commented on August 18, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.