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 30, 2022
1 parent de6e497 commit e4e8030
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 e4e8030

Please sign in to comment.