问题
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