Loop and firstItem parameters doesn't work together
See original GitHub issueIs this a bug report, a feature request, or a question?
Bug Report
Have you followed the required steps before opening a bug report?
(Check the step you’ve followed - replace the space character between the square brackets ([]
) by an x
.)
- I have read the guidelines regarding bug report.
- I have reviewed the documentation in its entirety, including the dedicated documentations 📚.
- I have searched for existing issues and made sure that the problem hasn’t already been reported.
- I am using the latest plugin version.
- I am following the issue template closely in order to produce a useful bug report.
Have you made sure that it wasn’t a React Native bug?
It seems to be an plugin implementation bug.
Is the bug specific to iOS or Android? Or can it be reproduced on both platforms?
Both Platforms
Is the bug reproductible in a production environment (not a debug one)?
Both environments
Environment
“react”: “16.5.0”, “react-native”: “0.57.1”, “react-native-snap-carousel”: “3.7.5”,
Using scrollview implementation or flatlist
Expected Behavior
The first banner to appear in the screen must be the one at the index 0 or any configured with firstItem parameter.
Actual Behavior
Carousel starts showing the central banner of the array and ignores any argument used in firstItem parameter.
Sample Code
<Carousel
data={this.state.bannerList}
renderItem={({item, index}) => {
return (<BannerCarrouselItem item={item}/>)
}}
sliderWidth={this.windowWidth}
itemWidth={this.windowWidth}
inactiveSlideOpacity={1}
inactiveSlideScale={1}
useScrollView={true}
loop={true} />
https://snack.expo.io/@calindratech/carousel-loop-vs-firstitem
Steps to Reproduce
The first render of the component is already enough to reproduce this behaviour.
Issue Analytics
- State:
- Created 5 years ago
- Comments:9 (3 by maintainers)
Top Results From Across the Web
Parameters in for loop, missing first one? - Stack Overflow
The second parameter is a conditional statement While that condition is 'true', the 'for' loop will continue to be executed.
Read more >5. Working with Arrays and Loops - JavaScript Cookbook [Book]
The function itself has three parameters: the array element, the index of the element, and the array. All three were used in the...
Read more >Loops — Ansible Documentation
When you run a task with until and register the result as a variable, the registered variable will include a key called “attempts”,...
Read more >Indexed collections - JavaScript - MDN Web Docs - Mozilla
This chapter introduces collections of data which are ordered by an index value. This includes arrays and array-like constructs such as ...
Read more >4. More Control Flow Tools — Python 3.11.1 documentation
It is an object which returns the successive items of the desired sequence when you iterate over it, but it doesn't really make...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
+1, when set loop = true, first item rendered incorrect!
This stills seems to not work.