Carousel wont render anything
See original GitHub issueI’m just trying this carousel, and it can’t even rendered.
I’m using your example as a reference.
What did i do wrong?
Code
const renderCarouselItem = ({ item }) => {
return (
<View style={{ flex: 1 }}>
<Text>{item.name}</Text>
</View>
);
};
render() {
return (
<View style={{ flex: 1 }} >
<Carousel
ref={(c) => { this._carousel = c; }}
data={[{ name: 'a' }, { name: 'b' }]}
renderItem={renderCarouselItem}
sliderWidth={400}
itemWidth={200}
/>
</View>
);
}
Packages
- “react”: “16.0.0-alpha.12”
- “react-native”: “0.46.4”
- “react-native-snap-carousel”: “^3.2.2”
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:7 (2 by maintainers)
Top Results From Across the Web
Why my react `Carousel` does not render properly?
First thing to note about your weird behaviour is that you are giving the wrong elements the key prop. Your Link (Outer most...
Read more >Carousel wont render anything · Issue #154 - GitHub
I'm just trying this carousel, and it can't even rendered. I'm using your example as a reference. What did i do wrong?
Read more >[Best solution]-Carousel.Item doesn't render anything when inside loop
I have below carousel in react js which works as expected when I individually define all 3 Carousel.Item but the same doesn't work...
Read more >React Bootstrap Carousel Component
A slideshow component for cycling through elements—images or slides of text—like a carousel. Example#. Carousels don't automatically normalize slide dimensions.
Read more >How to build a multi-image carousel in React and Tailwind
Blog header image for React multi-image carousel ... it allows us to create a fixed or static value that won't change between renders....
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
Hi @sitompul @agungjk,
Can you take a look at the answer I gave to a similar question and tell me if that helps?
@sitompul No problem 😉 I’ll make sure to add a note to the doc about handling item’s height because I don’t think I made it clear enough.