Вы можете использовать функцию генератора.
function* switchValues (value) {
while(true){
yield 0;
yield value;
}
}
const valueSwitcher = switchValues({ y: 10 })
console.log(valueSwitcher.next().value) //0
console.log(valueSwitcher.next().value) //the value you passed in, in this case an object
Она подберет выполнение функции там, где вы ее оставили в последний раз (после yield).
Вы можете попробовать использовать это в ваш код выглядит так:
if (this.descriptionRef.current) {
const { scrollHeight } = this.descriptionRef.current
setTimeout(function run() {
this.setState(valueSwitcher.next().value)
console.log(scrollHeight)
setTimeout(run, 7000)
}, 7000)
}