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 219dd52 commit 6176083Copy full SHA for 6176083
lib/hooks.ts
@@ -1,4 +1,4 @@
1
-import { useContext, useEffect, useState } from 'react';
+import { useContext, useEffect, useLayoutEffect, useState } from 'react';
2
3
import { ViewportContext } from './ViewportProvider';
4
import { IViewport, IScroll, IDimensions, PriorityType } from './types';
@@ -90,7 +90,7 @@ export const useLayoutSnapshot = <T = any>(
90
},
91
);
92
93
- useEffect(() => {
+ useLayoutEffect(() => {
94
setSnapshot(recalculateLayoutBeforeUpdate(getCurrentViewport()));
95
}, []);
96
0 commit comments