We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a380f11 commit e65bca5Copy full SHA for e65bca5
src/helpers/setAnimationFrameTimeout.ts
@@ -27,7 +27,12 @@ export function clearAnimationFrameTimeout(canceller: Canceller) {
27
cancelAnimationFrame(canceller.id)
28
}
29
30
+const isBrowser = typeof document !== 'undefined'
31
+
32
export function nextTick(callback: () => unknown) {
33
+ if (!isBrowser)
34
+ return setAnimationFrameTimeout(callback, 0)
35
36
return setTimeout(() => {
37
// Reading document.body.offsetTop can force browser to repaint before transition to the next state
38
Number.isNaN(document.body.offsetTop) || callback()
0 commit comments