Giter VIP home page Giter VIP logo

Comments (9)

vuquanghoang avatar vuquanghoang commented on August 20, 2024 1

I can see from the source code this line: if (cachedRules) return cachedRules;

I guess the cached stylesheet might be obsoleted after DOM changes couple of times.

from savesvgaspng.

vuquanghoang avatar vuquanghoang commented on August 20, 2024

@pavodev I also have the same issue. Did you use it with a react project?

from savesvgaspng.

pavodev avatar pavodev commented on August 20, 2024

Hi @vuquanghoang, yes I'm using it in a React project!

from savesvgaspng.

vuquanghoang avatar vuquanghoang commented on August 20, 2024

The reason might be this library stores cache for stylesheet. Whenever we change the content, especially if we use styled-component, the className changes => no longer match. It cannot map style to inline => some shape / appearance missing. my current solution is set extra value for className on some elements use selectorRemap function. it might not good enough but working.

@exupero do you have any idea for this case? can we disable cache in option?

from savesvgaspng.

pavodev avatar pavodev commented on August 20, 2024

Actually I'm not using styled components. Most of the SVG styles are managed by d3js (the library I'm using to draw my SVGs) and I fear this is the root problem in my case since both d3js and React work in parallel on the DOM, this may complicate everything

from savesvgaspng.

guslid avatar guslid commented on August 20, 2024

I just tested this library in a prototype I'm building and observed the issue on Firefox and Safari, but not on Chrome.

from savesvgaspng.

pavodev avatar pavodev commented on August 20, 2024

from savesvgaspng.

guslid avatar guslid commented on August 20, 2024

Are you also using React?

No, I'm not depending on React and not d3j.js either.

from savesvgaspng.

pavodev avatar pavodev commented on August 20, 2024

from savesvgaspng.

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.