From 5af3e803b0313154f42fbadba7dae6d32719c01c Mon Sep 17 00:00:00 2001 From: gorhom Date: Sat, 17 Aug 2024 19:39:38 +0200 Subject: [PATCH] fix: replaced deprecated reanimated Extrapolate with Extrapolation (#1875)(by @cenksari) --- example/src/components/customFooter/CustomFooter.tsx | 6 +++--- example/src/components/customHandle/CustomHandle.tsx | 10 +++++----- example/src/screens/integrations/map/Weather.tsx | 4 ++-- src/components/bottomSheet/BottomSheet.tsx | 4 ++-- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/example/src/components/customFooter/CustomFooter.tsx b/example/src/components/customFooter/CustomFooter.tsx index 1d3731cf8..afa1af4a1 100644 --- a/example/src/components/customFooter/CustomFooter.tsx +++ b/example/src/components/customFooter/CustomFooter.tsx @@ -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'; @@ -31,7 +31,7 @@ const CustomFooterComponent = ({ animatedIndex.value, [0, 1], [toRad(0), toRad(-180)], - Extrapolate.CLAMP + Extrapolation.CLAMP ); return { transform: [{ rotate: `${arrowRotate}rad` }], @@ -47,7 +47,7 @@ const CustomFooterComponent = ({ animatedIndex.value, [-0.85, 0], [0, 1], - Extrapolate.CLAMP + Extrapolation.CLAMP ), }), [animatedIndex] diff --git a/example/src/components/customHandle/CustomHandle.tsx b/example/src/components/customHandle/CustomHandle.tsx index 0cc100878..5c90299f9 100644 --- a/example/src/components/customHandle/CustomHandle.tsx +++ b/example/src/components/customHandle/CustomHandle.tsx @@ -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, @@ -28,7 +28,7 @@ const CustomHandleComponent: React.FC = ({ animatedIndex.value, [0, 1, 2], [-1, 0, 1], - Extrapolate.CLAMP + Extrapolation.CLAMP ), [animatedIndex.value] ); @@ -41,7 +41,7 @@ const CustomHandleComponent: React.FC = ({ animatedIndex.value, [1, 2], [20, 0], - Extrapolate.CLAMP + Extrapolation.CLAMP ); return { borderTopLeftRadius: borderTopRadius, @@ -60,7 +60,7 @@ const CustomHandleComponent: React.FC = ({ animatedIndex.value, [0, 1, 2], [toRad(-30), 0, toRad(30)], - Extrapolate.CLAMP + Extrapolation.CLAMP ); return { transform: transformOrigin( @@ -86,7 +86,7 @@ const CustomHandleComponent: React.FC = ({ animatedIndex.value, [0, 1, 2], [toRad(30), 0, toRad(-30)], - Extrapolate.CLAMP + Extrapolation.CLAMP ); return { transform: transformOrigin( diff --git a/example/src/screens/integrations/map/Weather.tsx b/example/src/screens/integrations/map/Weather.tsx index 981eabd0c..bfbb88b16 100644 --- a/example/src/screens/integrations/map/Weather.tsx +++ b/example/src/screens/integrations/map/Weather.tsx @@ -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'; @@ -44,7 +44,7 @@ const Weather = ({ animatedIndex, animatedPosition }: WeatherProps) => { animatedIndex.value, [1, 1.125], [1, 0], - Extrapolate.CLAMP + Extrapolation.CLAMP ), transform: [ { diff --git a/src/components/bottomSheet/BottomSheet.tsx b/src/components/bottomSheet/BottomSheet.tsx index cb4337486..bf4e9c26e 100644 --- a/src/components/bottomSheet/BottomSheet.tsx +++ b/src/components/bottomSheet/BottomSheet.tsx @@ -15,7 +15,7 @@ import Animated, { useDerivedValue, runOnJS, interpolate, - Extrapolate, + Extrapolation, runOnUI, cancelAnimation, useWorkletCallback, @@ -501,7 +501,7 @@ const BottomSheetComponent = forwardRef( animatedPosition.value, adjustedSnapPoints, adjustedSnapPointsIndexes, - Extrapolate.CLAMP + Extrapolation.CLAMP ) : -1;