Help me combine those two packages, please.
I need slider for tabs, which looks something like that:
< | tab 1 | tab 2 | tab 3 | tab 4 | >
-------------------------------------
| Panel |
-------------------------------------
What I do? I wrap tabs I need to slider:
import Slider from "react-slick";
import { Tab, Tabs, TabList, TabPanel } from 'react-tabs';
const sliderProps = {
dots: false,
speed: 500,
slidesToShow: 1,
slidesToScroll: 1,
arrows: false,
centerMode: true,
variableWidth: true,
infinite: false
};
...
<Tabs>
<TabList>
<Slider {...sliderProps}>
<Tab>1</Tab>
<Tab>2</Tab>
<Tab>3</Tab>
</Slider>
</TabList>
<TabPanel>
Sample content 1
</TabPanel>
<TabPanel>
Sample content 2
</TabPanel>
<TabPanel>
Sample content 3
</TabPanel>
</Tabs>
But when I click any tab first tab becomes active and future clicks doesn't work.
And in colsole I get error:
Warning: Failed prop type: Invalid prop `tabIndex` of type `number` supplied to `Tab`, expected `string`.