Swipeable: How to convert RN Animated.AnimatedInterpolation<number> to Reanimated Adaptable<number>
How to convert RN Animated.AnimatedInterpolation
https://software-mansion.github.io/react-native-gesture-handler/docs/component-swipeable.html#renderleftactions https://github.com/software-mansion/react-native-gesture-handler/blob/master/Swipeable.js
react-native-gesture-handler/Swipeable.js
/**
*
* This map describes the values to use as inputRange for extra interpolation:
* AnimatedValue: [startValue, endValue]
*
* progressAnimatedValue: [0, 1]
* dragAnimatedValue: [0, +]
*
* To support `rtl` flexbox layouts use `flexDirection` styling.
* */
renderLeftActions?: (
progressAnimatedValue: Animated.AnimatedInterpolation,
dragAnimatedValue: Animated.AnimatedInterpolation
) => React.ReactNode;
Reanimated:
export type Adaptable<T> =
| T
| AnimatedNode<T>
| ReadonlyArray<T | AnimatedNode<T> | ReadonlyArray<T | AnimatedNode<T>>>;
Solution: https://github.com/iyegoroff/react-native-reanimated-swipeable-views
@MikePodgorniy Could you share with me what is the solution? I checked your repo and raw you rebuild the swipeable component instead of converting Animated.AnimatedInterpolation to AnimatedNode.
https://gist.github.com/MikePodgorniy/5ffeba5c08879de0eb82978d0cf3fac3
you need to use translation from render callback https://github.com/iyegoroff/react-native-reanimated-swipeable-views/blob/master/src/swipeable.tsx
@MikePodgorniy Could you share with me what is the solution? I checked your repo and raw you rebuild the swipeable component instead of converting
Animated.AnimatedInterpolationtoAnimatedNode.
I can't see the line where the conversion takes place, can you please help me out here @tuanmai?
Is possible?