я запускаю функцию которая обробляет дом —-function spawnColor(iter) {
this.goFrames = 0;
this.color = rgbRedValue;
this.iteration = iter;
this.fillColor = function () {
if (this.goFrames <= 20) {
var $el = document.querySelector(
".js-guage-svg > path:nth-child(" + String(this.iteration) + ")"
);
document.querySelector(
".js-guage-svg > path:nth-child(" + String(this.iteration) + ")"
).style.fill = "#44BCFF";
this.color = this.color - rgbRedValue / 20;
this.goFrames = this.goFrames + 1;
this.reqAnim = requestAnimationFrame(this.fillColor.bind(this));
} else {
this.goFrames = 0;
this.color = rgbRedValue;
cancelAnimationFrame(this.reqAnim);
}
};
}
ну лучше все делать в реакте самом. реакт + работа с домом напрямую, не самый лучший путь