0

I'm reading code from a library and came across this:

return Animated.event([null, this.createAnimatedEvent()])(
  event,
  gestureState
)

The library uses:

    "react": "^16.0.0-beta.5",
    "react-native": "^0.49.1"

I've checked the Animated.event() API and source code for that version and it returns void.

I have a suspicion that it's something to do with PanResponder because of the gestureState param but can't connect it together from the docs.

The library is: https://github.com/alexbrillant/react-native-deck-swiper and the snippet starts at line 195 in Swiper.js

Vgoose
  • 249
  • 1
  • 10

1 Answers1

0

After playing with it, it seems that Animated.event() is initialized by the array of argument mappings. Then it returns a function to be called with said arguments.

It's a weird pattern.

Vgoose
  • 249
  • 1
  • 10