how to update states using state inside setInterval?

I have to update timers every 1 sec. timers is a map. Currently when setInterval is run, it has an closure of the values already present inside it, therefore the time inside it is not updated.
code

i want to update ids inside timers every second