Skip to content

Commit

Permalink
Fix usePreventScroll on iOS with React 17 (#1196)
Browse files Browse the repository at this point in the history
  • Loading branch information
devongovett authored Oct 27, 2020
1 parent 5919197 commit 2ca7fc0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/@react-aria/overlays/src/usePreventScroll.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
*/

import {chain, getScrollParent} from '@react-aria/utils';
import {useEffect} from 'react';
import {useLayoutEffect} from 'react';

interface PreventScrollOptions {
/** Whether the scroll lock is disabled. */
Expand All @@ -38,7 +38,7 @@ const visualViewport = typeof window !== 'undefined' && window.visualViewport;
export function usePreventScroll(options: PreventScrollOptions = {}) {
let {isDisabled} = options;

useEffect(() => {
useLayoutEffect(() => {
if (isDisabled) {
return;
}
Expand Down

0 comments on commit 2ca7fc0

Please sign in to comment.