Displaying react components in carousel using react-slick

ilyabasiuk picture ilyabasiuk · Jul 8, 2016 · Viewed 9.8k times · Source

I am trying to use react-slick for displaying my custom Components inside carousel:

    <Slider {...settings}>
        <Hello />
        <Hello />
    </Slider>

But seems that react-slick doens't support such way of using.

JsFiddle demo

https://jsfiddle.net/jqLzpewm/

Answer

Alexandr Lazarev picture Alexandr Lazarev · Jul 8, 2016

It works, it's all about styling the carousel. I've updated your fiddle to show that it works: https://jsfiddle.net/ox1ujxa4/1/

Just some minor styling made:

<div style={{display: 'inline-block', width: 500}}>
  Hello
</div>