react-native-snap-carousel
react-native-snap-carousel copied to clipboard
Updated readme with functional example
Platforms affected
- All platforms
What does this PR do?
- Adds a functional component example to readme
What testing has been done on this change?
- It is a working example of a functional component. Just a change to readme.
Tested features checklist
- [x ] Default setup (example)
- [ x] Carousels with and without momentum enabled (prop
enableMomentum
) - [ x] Vertical carousels (prop
vertical
) - [ x] Slide alignment (prop
activeSlideAlignment
) - [ x] Autoplay (prop
autoplay
) - [ x] Loop mode (prop
loop
) - [ x]
ScrollView
/FlatList
carousels (propuseScrollView
) - [ x] Callback methods
- [ x]
ParallaxImage
component - [ x]
Pagination
component - [ x] Layouts and custom interpolations
Hi! I'm not a maintainer but I also find this to be very useful in the docs, specially to newcomers.
If I may, I'd like to suggest reducing the functional component example to the bare minimum necessary to produce a working example. I'd remove the styles and the set of test elements and present an example perfectly analog to the Class Based example.
And I also think this should be the first example listed in the docs, as it should be the most common use case by now.
Hope I'm not being annoying, this is a good addition to the docs, cheers!
Thank you @SirKadogan, this is a nice addition!
Three observations though:
- Please limit the PR to the new code. Currently there are plenty of minor updates in the file changes that are irrelevant to the PR and that I don't feel like merging (quote marks and line breaks in particular).
- Your branch has conflicts and needs to be rebased.
- @eduardopelitti's comments are spot on! Mind taking them into account?
Thanks a lot 🙏
@bd-arc sure, I'll make the changes when I have the time.
Although I agree with @eduardopelitti that a cleaner example is better, if I remember correctly the default example was all misaligned when I first tested it and was a bit confusing to understand visually. Some styling seems to help, as a new dev can actually visualize squares moving side to side
Is this still an improvement to the lib? lol it's been 3 years.
If it is I can find time to do it this week