question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Carousel wont render anything

See original GitHub issue

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?

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:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
bd-arccommented, Sep 19, 2017

Hi @sitompul @agungjk,

Can you take a look at the answer I gave to a similar question and tell me if that helps?

0reactions
bd-arccommented, Sep 19, 2017

@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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found