gilbarbara/react-inlinesvg

trigger `preProcessor` multiple times

gencer opened this issue ยท 2 comments

On 0.8.4, when I use processSVG method, i was able to re-render SVG with multiple times.

For example, lets say you send a message and message tick (svg icon) placed in as gray colored. After message delivered I update the state as delivered (boolean). This makes processSVG being triggered and SVG re-renders with new color because delivered is now true. I can replace fill color in processSVG after i load the svg icon.

In 1.x, this becomes once-only. It process at load time once and no longer process when state changes.

How can I trigger preProcessor second or third (and more) time on SVG?

Hey,
That was a bug...
You can set a different key in the component to trigger a new render.

A bug, that works for me. A bug with a purpose. ๐Ÿ˜

key did the trick.

Thanks!