hyochan / react-native-masonry-list

The Masonry List implementation which has similar implementation as the `FlatList` in React Native
MIT License
393 stars 55 forks source link

Ability to use onScroll with the List #26

Closed kayode0x closed 2 years ago

kayode0x commented 2 years ago

I need to use onScoll to control my header, it's available to the native FlatList but it's not here. Can you fix this, please? thanks.

ps I get this error:

onScroll: (event: any) => void; }' is not assignable to type 'IntrinsicAttributes & Props<unknown>'.
  Property 'onScroll' does not exist on type 'IntrinsicAttributes & Props<unknown>'.
jzxchiang1 commented 2 years ago

Not sure why this was explicitly disabled.

kayode0x commented 2 years ago

@jzxchiang1 were you able to fix this?

jzxchiang1 commented 2 years ago

Unfortunately not. I had to patch the package using npx patch-package .... It's actually quite a simple change locally.

kayode0x commented 2 years ago

Were you able to use onScroll after patching the package? 😮

jzxchiang1 commented 2 years ago

Yeah, so I wanted to use an Animated.event inside the onScroll, so I manually changed the library code to use that (and made the ScrollView an Animated.ScrollView).

kayode0x commented 2 years ago

Awesome, do you mind sharing your code? thanks

kayode0x commented 2 years ago

hey @jzxchiang1, can you share your source code or walkthrough on how to get this? thanks again

danielprrazevedo commented 1 year ago

@jzxchiang1 I'm a little late, but if you're still having problems, check this out and see if it can help you.