Answer the question
In order to leave comments, you need to log in
How to implement number changing animation using React.js?
There is a function that should create animations of running numbers (in the fragment, the insertion into the HTML code is cut out) I don’t quite understand how to properly adapt it for a react application?
const outNum = (num) => {
let t = Math.random(time/(num/step))
let n = 0;
let interval = setInterval(() => {
n = n + step;
if(n == num){
clearInterval(interval)
}
}, t);
return n;
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question