Answer the question
In order to leave comments, you need to log in
Is there no way to clear 'interval' when we return it from another function and then call clear(clearInterval)?
Ready code:
https://stackblitz.com/edit/react-f2yr8t
When I assign the result of the function execution to a variable, then I pass it to clearInterval, everything works. Thank you.
Answer the question
In order to leave comments, you need to log in
Some kind of shitty question, it’s not clear what the question is, of course, you need to save the result of each call to the interval. it's a new interval every time.
Even if you wrap it in ten functions, you still call it several times.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question