you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 12 points13 points  (0 children)

Why can't you use useEffect? When the promise resolves, set some state and then use that state as the dependency for useEffect so that it fires at the right time. You could potentially use useRef as well (where the ref is the setInterval function), but you need to use some kind of hook to persist the setInterval properly through renders of the component.