Invariant Violation: VirtualizedList: The windowSize prop must be present and set to a value greater than 0
See original GitHub issueI am getting error as shown in the title react-native: 0.56.0 react-native-snap-carousel: ^3.7.2
const horizontalMargin = 20;
const slideWidth = 280;
const sliderWidth = Dimensions.get("window").width;
const itemWidth = slideWidth + horizontalMargin * 2;
const itemHeight = 100;
//
_renderItem = ({ item }) => {
return (
<View style={style.slide}>
<View style={style.slideInnerContainer} />
</View>
);
};
render() {
return (
<View style={style.container}>
<Carousel
data={[{ key: "1" }, { key: "2" }, { key: "3" }]}
renderItem={this._renderItem}
slideWidth={sliderWidth}
itemWidth={itemWidth}
/>
</View>
);
}
Issue Analytics
- State:
- Created 5 years ago
- Reactions:8
- Comments:15 (4 by maintainers)
Top Results From Across the Web
Invariant Violation: VirtualizedList: The windowSize prop ...
Invariant Violation : VirtualizedList: The windowSize prop must be present and set to a value greater than 0.
Read more >React Native Snap Carousel: Invariant Violation
js where it expects inputRange for interpolation to be an array of numbers. So my best guess is react-native-snap-carousel uses itemWidth value ......
Read more >VirtualizedList
This includes the data prop and parent component state. In order to constrain memory and enable smooth scrolling, content is rendered ...
Read more >FlatList listKey
[React Native Flatlist] getting 'Invariant Violation: `refreshing` prop must be set as a boolean in order to use `onRefresh`, but got `undefined`' Close....
Read more >Understand onViewableItemsChanged in FlatList - RY 's Blog
onViewableItemsChanged is a prop in VirtualizedList and FlatList. ... Minimum amount of time (in milliseconds) that an item must be ...
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
Ok I added
windowSize={1}
and it workedprovide both sliderWidth={400} itemWidth={400}