react-slick custom paging paging prop usage

拥有回忆 提交于 2019-12-25 05:20:12

问题


I have set up the prop to pass to react-slick Slider as follows:

const settings = {
    customPaging: function(i) {
        return <a><div>{`Test ${i}`}</div></a>
    }
};

And pass it into the slider as:

<Slider {...settings}>
    {this.Slides()}
</Slider>

yet when I test the component I do not get the custom paging that I expected - where I would expect to see the text 'Test 0' I still see the default dot. I took a look at the custom paging example in the documentation and nothing stood out to me as being different than what I did.

Does anyone have any suggestions?


回答1:


I have discovered the issue / solution:

I was on react-slick@0.14.2 which did not include the update for custom paging - upgrading to the latest version of react-slick has fixed the issue



来源:https://stackoverflow.com/questions/43150266/react-slick-custom-paging-paging-prop-usage

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!