nuclearpasta / react-native-drax

A drag-and-drop system for React Native
MIT License
554 stars 69 forks source link

Is it possible to pass my own onScroll to DraxList? #63

Closed afgarcia86 closed 3 years ago

afgarcia86 commented 4 years ago

I am trying to replace a react-native-draggable-flatlist with this library however they have a onScrollOffsetChange prop that allows me to do a parallax effect while scrolling. If I can pass my own onScroll to the FlatList I should be able to replicate the same effect.

example:

onScroll={({ nativeEvent }) => {
    this.state.scrollY.setValue(nativeEvent.contentOffset.y);
}}

Alternatively is there a way to use values form the useDraxRegistry?

lafiosca commented 4 years ago

Off the top of my head, I don’t believe this is currently supported, but it should be relatively easy to add.

afgarcia86 commented 4 years ago

That was pretty easy https://github.com/nuclearpasta/react-native-drax/pull/64

lafiosca commented 3 years ago

Technically I think this is more of a bug than a feature request, since the library intends to allow you to pass all of the underlying FlatList props and have them honored. We create our own onScroll and currently ignore the prop entirely, even though it is passable to DraxList. Either way, we'll add it.