const updateStroke = () => {
let timer = setInterval(() => {
setStroke(stroke => {
console.log(stroke);
if (stroke > 1250) {
clearInterval(timer);
return 1256;
} else {
return stroke + 250;
}
});
}, 1000);
};