Bowen7 / react-rough-fiber

A React renderer for rendering hand-drawn SVGs.
https://react-rough-fiber.amind.app
MIT License
397 stars 8 forks source link

remote SVG cannot be animated #6

Open mashakos opened 1 month ago

mashakos commented 1 month ago

when using the following from the examples along with a dynamic seed value, the resultant svg does not animate

      <SVG
        src="https://cdn.svgporn.com/logos/react.svg"
        width={256}
        height="auto"
        title="React"
      />
Bowen7 commented 1 month ago

react-inlinesvg only calls getElement when title or description changes: https://github.com/gilbarbara/react-inlinesvg/blob/14ddfe33ead89c90a0c9b9727ec78455fdddf6ac/src/index.tsx#L199-L201

If you want to create an animated remote SVG, you might need to add a dynamic key to the SVG:

<SVG
  src="https://cdn.svgporn.com/logos/react.svg"
  width={256}
  height="auto"
  title="React"
  key={seed}
/>