machadogj / react-native-carousel-control

React Native Carousel control with support for iOS and Android
MIT License
247 stars 55 forks source link

Can't make it work with only one element #11

Closed sconxu closed 7 years ago

machadogj commented 8 years ago

Hi @sconxu, do you see any error messages? What do you see?

On Thu, Sep 8, 2016 at 1:16 PM, sconxu notifications@github.com wrote:

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/machadogj/react-native-carousel-control/issues/11, or mute the thread https://github.com/notifications/unsubscribe-auth/AAo97Os2rK8G56wkmQQFf1F6U65oi8U-ks5qoDT6gaJpZM4J4Ldn .

sconxu commented 8 years ago

Hi. This is the error i get:

simulator screen shot sep 8 2016 7 52 45 pm

machadogj commented 8 years ago

Can you show me the code?

On Thu, Sep 8, 2016 at 1:54 PM, sconxu notifications@github.com wrote:

Hi. This is the error i get:

[image: simulator screen shot sep 8 2016 7 52 45 pm] https://cloud.githubusercontent.com/assets/3735664/18358514/13ae0b7c-75fe-11e6-94b6-ce26d2d06980.png

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/machadogj/react-native-carousel-control/issues/11#issuecomment-245664007, or mute the thread https://github.com/notifications/unsubscribe-auth/AAo97Nw2H981_-Txpg_2a9aZ5eVZsrdxks5qoD3WgaJpZM4J4Ldn .

sconxu commented 8 years ago

Sure,

`<Carousel pageStyle={{backgroundColor: 'white', borderRadius: 5}} pageWidth={Config.productsCarouselPageWidth} sneak={75} initialPage={0}

</Carousel`>

machadogj commented 8 years ago

Can you try changing <CarouselElement> with <Text>Hello world</Text>? If that works, then CarouselElement's render might be returning "null" (??).

On Thu, Sep 8, 2016 at 2:03 PM, sconxu notifications@github.com wrote:

Sure,

<Carousel pageStyle={{backgroundColor: 'white', borderRadius: 5}} pageWidth={Config.productsCarouselPageWidth} sneak={75} initialPage={0}

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/machadogj/react-native-carousel-control/issues/11#issuecomment-245666700, or mute the thread https://github.com/notifications/unsubscribe-auth/AAo97DiChHDOHiFRaDkLvuaU9LmmClVOks5qoD_wgaJpZM4J4Ldn .

machadogj commented 8 years ago

Actually, sorry, my bad, looks like it's not an array when there's only one element: https://facebook.github.io/react/tips/children-props-type.html I'll try to fix this later today. Feel free to submit a PR if you want. Thanks for reporting!

On Thu, Sep 8, 2016 at 2:10 PM, Gustavo Machado machadogj@gmail.com wrote:

Can you try changing <CarouselElement> with <Text>Hello world</Text>? If that works, then CarouselElement's render might be returning "null" (??).

On Thu, Sep 8, 2016 at 2:03 PM, sconxu notifications@github.com wrote:

Sure,

<Carousel pageStyle={{backgroundColor: 'white', borderRadius: 5}} pageWidth={Config.productsCarouselPageWidth} sneak={75} initialPage={0}

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/machadogj/react-native-carousel-control/issues/11#issuecomment-245666700, or mute the thread https://github.com/notifications/unsubscribe-auth/AAo97DiChHDOHiFRaDkLvuaU9LmmClVOks5qoD_wgaJpZM4J4Ldn .

sconxu commented 8 years ago

Yep. Sounds like it. Thanks for the quick response!

machadogj commented 7 years ago

@sconxu this has been fixed by @csettle-sl and published in v1.0.4. Thanks!