Vue has this nextTick
function, which is an async function that waits until the DOM is flushed. This is particularly useful when you want to perform some operation directly upon an element, like scrolling a DIV with scroll()
. This avoids the need to wrap this call into a blind setTimeout()
.
In React I resorted to setTimeout()
in the past. Is there an equivalent to nextTick()
, or any better way to do it?