r/reactnative • u/weahforsage • Nov 29 '20
React native animated pagination dots, links in the comment
4
Nov 29 '20
Does this work with reanimted2 shared value?
3
u/weahforsage Nov 29 '20
I don't really know about reanimated, but should be same as Animated.Value. I guess yes. I tried make depends reanimated, but didn't go well. I'll look at it later.
2
3
u/chase32 Nov 30 '20 edited Nov 30 '20
Looks cool but when I tried to test it out, its telling me: Style property 'width' is not supported by native animated module.
Edit: Looks like I had to change the onScroll of my Flatlist to not use the native driver.
onScroll={Animated.event( [{ nativeEvent: { contentOffset: { x: scrollX } } }], { useNativeDriver: false } )}
Working now, looks nice!
1
2
u/DimensionSufficient1 Nov 30 '20
This is awesome :) Would you be interested in sharing/talking about it on our React Native Nation discord? https://discord.com/invite/KcxDrQA
1
1
u/ncuillery Nov 29 '20
Thatβs cool!
Sorry to ask this but does anyone know what Flutter package would be the closest equivalent of this?
1
u/s_jatin Nov 29 '20
Does it requires to have different pagination tho?
1
u/weahforsage Nov 30 '20
Like what, sorry i don't get it.
1
u/s_jatin Nov 30 '20
Ahh sorry. Should have been more specific. Like screen pagination. Or does it renders within a single screen but contains its own subpagination (in this case 4)
1
u/weahforsage Nov 30 '20
As long as you using Flatlist or other component using onScroll event which is contains currentOffset.x it'll work.
1
Feb 12 '21
Does it handle like 30 pages? Or do dots fall out of screen if you go that high?
1
u/weahforsage Feb 12 '21
Unfortunately, it doesn't yet. I'll figure it out in the future
1
2
u/henryp_dev iOS & Android Nov 29 '20
This is really cool! Awesome work. I wanted something like this a while ago
2
2
u/tsalama7 Nov 30 '20
Dude thank you. I was just looking for a library that handles this β literally yesterday.
2
Nov 30 '20
How have I been working at a company that's been using the 'sliding dot' one for over a year and this repo nowhere near that old?
1
1
u/anaste97 Dec 01 '20
Nice one π maybe i will contribute soon;)
I have a diff Q if u don't mind,
If i want to add a next/prev button I'm trying to handle it with scrollToOffset But it's not work as expected! Can u help on this? I figured the issue, the onMomentumScrollEnd not triggered:/ (Android)
Https://snack.expo.io/@anastely/onboarding-ex
14
u/weahforsage Nov 29 '20
https://github.com/weahforsage/react-native-animated-pagination-dots