Skip to content

Commit

Permalink
fix: replaced deprecated reanimated Extrapolate with Extrapolation (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
gorhom committed Aug 17, 2024
1 parent d8d34fa commit 5af3e80
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
6 changes: 3 additions & 3 deletions example/src/components/customFooter/CustomFooter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
} from '@gorhom/bottom-sheet';
import { useSafeAreaInsets } from 'react-native-safe-area-context';
import Animated, {
Extrapolate,
Extrapolation,
interpolate,
useAnimatedStyle,
} from 'react-native-reanimated';
Expand All @@ -31,7 +31,7 @@ const CustomFooterComponent = ({
animatedIndex.value,
[0, 1],
[toRad(0), toRad(-180)],
Extrapolate.CLAMP
Extrapolation.CLAMP
);
return {
transform: [{ rotate: `${arrowRotate}rad` }],
Expand All @@ -47,7 +47,7 @@ const CustomFooterComponent = ({
animatedIndex.value,
[-0.85, 0],
[0, 1],
Extrapolate.CLAMP
Extrapolation.CLAMP
),
}),
[animatedIndex]
Expand Down
10 changes: 5 additions & 5 deletions example/src/components/customHandle/CustomHandle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, { memo, useMemo } from 'react';
import { StyleProp, StyleSheet, Text, ViewStyle } from 'react-native';
import { BottomSheetHandleProps } from '@gorhom/bottom-sheet';
import Animated, {
Extrapolate,
Extrapolation,
interpolate,
useAnimatedStyle,
useDerivedValue,
Expand All @@ -28,7 +28,7 @@ const CustomHandleComponent: React.FC<CustomHandleProps> = ({
animatedIndex.value,
[0, 1, 2],
[-1, 0, 1],
Extrapolate.CLAMP
Extrapolation.CLAMP
),
[animatedIndex.value]
);
Expand All @@ -41,7 +41,7 @@ const CustomHandleComponent: React.FC<CustomHandleProps> = ({
animatedIndex.value,
[1, 2],
[20, 0],
Extrapolate.CLAMP
Extrapolation.CLAMP
);
return {
borderTopLeftRadius: borderTopRadius,
Expand All @@ -60,7 +60,7 @@ const CustomHandleComponent: React.FC<CustomHandleProps> = ({
animatedIndex.value,
[0, 1, 2],
[toRad(-30), 0, toRad(30)],
Extrapolate.CLAMP
Extrapolation.CLAMP
);
return {
transform: transformOrigin(
Expand All @@ -86,7 +86,7 @@ const CustomHandleComponent: React.FC<CustomHandleProps> = ({
animatedIndex.value,
[0, 1, 2],
[toRad(30), 0, toRad(-30)],
Extrapolate.CLAMP
Extrapolation.CLAMP
);
return {
transform: transformOrigin(
Expand Down
4 changes: 2 additions & 2 deletions example/src/screens/integrations/map/Weather.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { useCallback, useMemo, useState } from 'react';
import { LayoutChangeEvent, StyleSheet } from 'react-native';
import Animated, {
Extrapolate,
Extrapolation,
interpolate,
useAnimatedStyle,
} from 'react-native-reanimated';
Expand Down Expand Up @@ -44,7 +44,7 @@ const Weather = ({ animatedIndex, animatedPosition }: WeatherProps) => {
animatedIndex.value,
[1, 1.125],
[1, 0],
Extrapolate.CLAMP
Extrapolation.CLAMP
),
transform: [
{
Expand Down
4 changes: 2 additions & 2 deletions src/components/bottomSheet/BottomSheet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import Animated, {
useDerivedValue,
runOnJS,
interpolate,
Extrapolate,
Extrapolation,
runOnUI,
cancelAnimation,
useWorkletCallback,
Expand Down Expand Up @@ -501,7 +501,7 @@ const BottomSheetComponent = forwardRef<BottomSheet, BottomSheetProps>(
animatedPosition.value,
adjustedSnapPoints,
adjustedSnapPointsIndexes,
Extrapolate.CLAMP
Extrapolation.CLAMP
)
: -1;

Expand Down

0 comments on commit 5af3e80

Please sign in to comment.