v1.1.0
Added support of rendering React components, render functions and JSX elements.
Components and functions recieve props specified in data
and additional index
props.
import FirstScreen from "./FirstScreen";
import SecondScreen from "./SecondScreen";
...
const data = [
{
tabLabel: 'Valid component in form of JSX element',
component: <FirstScreen/>,
},
{
tabLabel: 'Valid component in form of React component',
component: SecondScreen,
props: {}, // additional props
},
{
tabLabel: 'Valid component in form of render function',
component: ({index, ...props}) => {},
props: {}, // additional props
},
];
return <Swiper data={data}/>;