Skip to content

Commit c90921a

Browse files
committed
Update useLockBodyScroll implementation
1 parent cc2c0ed commit c90921a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -634,7 +634,7 @@ export function useLocalStorage(key, initialValue) {
634634
}
635635

636636
export function useLockBodyScroll() {
637-
React.useEffect(() => {
637+
React.useLayoutEffect(() => {
638638
const originalStyle = window.getComputedStyle(document.body).overflow;
639639
document.body.style.overflow = "hidden";
640640
return () => {

0 commit comments

Comments
 (0)