virtualContext: drop useLayoutEffect

This commit is contained in:
Liam Fitzgerald 2021-04-26 17:04:36 +10:00
parent aaea592cfc
commit 7a6b2eb015
No known key found for this signature in database
GPG Key ID: D390E12C61D1CFFB

View File

@ -43,8 +43,8 @@ export function useVirtualResizeState(s: boolean) {
[_setState, save]
);
useLayoutEffect(() => {
restore();
useEffect(() => {
requestAnimationFrame(restore);
}, [state]);
return [state, setState] as const;
@ -58,7 +58,7 @@ export function useVirtualResizeProp(prop: Primitive) {
save();
}
useLayoutEffect(() => {
useEffect(() => {
requestAnimationFrame(restore);
}, [prop]);