I am using setTimeout in my react native app like this:
run() {
console.log('test');
let x = setTimeout(()=>{
this.run();
}, 500);
}
componentDidMount() {
this.run();
}
I tested out 10 components having the code above and render them at the same time and it heavily slows down the app. Is there a way to run multiple setTimeout without affecting the app's performance? Thank you.