Skip to content

Why does ReanimatedSwipeable renderRightAction allow multiple parameters instead of a props object? #3404

Answered by latekvo
EddyVinck asked this question in Q&A
Discussion options

You must be logged in to vote

Hey, I originally took this decision to maintain high backwards-compatibility with the Swipeable.
I admit this might've been a poor decision, and I tried a couple of approaches to transition from the multi-prop to a single-prop function signature since. Unfortunately, while the JS logic for this kind of a transition is fairly simple, type issues prevent us from applying any of these changes.

type RenderActionType = {
  (props: {
    progress: SharedValue<number>;
    translation: SharedValue<number>;
    swipeableMethods: SwipeableMethods;
  }): React.ReactNode;
  (
    progress: SharedValue<number>,
    translation: SharedValue<number>,
    swipeableMethods: SharedValue<number>
  ): React.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@EddyVinck
Comment options

Answer selected by EddyVinck
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants