Skip to content

Commit c8aac02

Browse files
committed
Reduce raf timeout to 35ms
1 parent bb804cd commit c8aac02

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

hooks/src/index.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,10 @@ let oldCommit = options._commit;
2525
let oldBeforeUnmount = options.unmount;
2626
let oldRoot = options._root;
2727

28-
const RAF_TIMEOUT = 100;
28+
// We take the minimum timeout for requestAnimationFrame to ensure that
29+
// the callback is invoked after the next frame. 35ms is based on a 30hz
30+
// refresh rate, which is the minimum rate for a smooth user experience.
31+
const RAF_TIMEOUT = 35;
2932
let prevRaf;
3033

3134
/** @type {(vnode: import('./internal').VNode) => void} */

0 commit comments

Comments
 (0)