How to use useDrawerProgress with Reanimated 2 (types issue) #3395
Unanswered
joshuaaron
asked this question in
Q&A
Replies: 1 comment
-
It seems just passing the value outside of a One other comment/question is when should you use const translateX = interpolateNode(progress as any, {
inputRange: [0, 1],
outputRange: [-120, 0],
extrapolate: Extrapolate.CLAMP,
});
return (
<Animated.View style={{ transform: [{ translateX }] }}>...</Animated.View>
) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Trying to interpolate the progress value returned from
useDrawerProgress
fromreact-navigation (v6)
but having some type related issues.The returned value from
useDrawerProgress
isReadonly<Animated.SharedValue<number>> | Animated.Node<number>
where the first argument tointerpolateNode
from reanimated isAnimated.Adaptable<number>
. Likewise tointerpolate
as it takes just a number.When trying to pass the progress value in, typescript errors at
Type 'Readonly<SharedValue<number>>' is not assignable to type 'Adaptable<number>'
Anyone know how to get these to work together?
Beta Was this translation helpful? Give feedback.
All reactions