Skip to content

Commit ff563a3

Browse files
author
Petr Konecny
committed
feat: removed shared value as param
1 parent e0d92ac commit ff563a3

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

example/examples/AnimatedExample.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ const Slide = ({ image, title, index }: { image: string; title: string; index: n
2424
const { index: slideIndex, total } = useAutoCarouselSlideIndex()
2525

2626
const rStyle = useAnimatedStyle(() => {
27-
const progress = interpolateInsideCarousel(scrollValue, slideIndex, total, {
27+
const progress = interpolateInsideCarousel(scrollValue.value, slideIndex, total, {
2828
slideBefore: 0,
2929
thisSlide: 1,
3030
slideAfter: 0,

src/utils/interpolateInsideCarousel.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import { Extrapolation, interpolate, SharedValue } from 'react-native-reanimated'
1+
import { Extrapolation, interpolate } from 'react-native-reanimated'
22

33
export const interpolateInsideCarousel = (
4-
scrollValue: SharedValue<number>,
4+
scrollValue: number,
55
slideIndex: number,
66
totalLength: number,
77
values: {
@@ -35,5 +35,5 @@ export const interpolateInsideCarousel = (
3535

3636
const outputValues = [inside, incoming, outgoing, inside, incoming, outgoing, inside]
3737

38-
return interpolate(scrollValue.value, inputRange, outputValues, Extrapolation.CLAMP)
38+
return interpolate(scrollValue, inputRange, outputValues, Extrapolation.CLAMP)
3939
}

0 commit comments

Comments
 (0)