Skip to content

Commit

Permalink
Replace Dimensions with useWindowDimensions hook
Browse files Browse the repository at this point in the history
  • Loading branch information
fluiddot committed Mar 29, 2022
1 parent 3538ac4 commit 440217c
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* External dependencies
*/
import { Dimensions } from 'react-native';
import { useWindowDimensions } from 'react-native';
import {
useSharedValue,
useAnimatedRef,
Expand Down Expand Up @@ -36,7 +36,7 @@ export default function useScrollWhenDragging() {
const animatedScrollRef = useAnimatedRef();
animatedScrollRef( scrollRef );

const windowHeight = Dimensions.get( 'window' ).height;
const { height: windowHeight } = useWindowDimensions();

const velocityY = useSharedValue( 0 );
const offsetY = useSharedValue( 0 );
Expand Down

0 comments on commit 440217c

Please sign in to comment.