Skip to content

v1.1.0

Compare
Choose a tag to compare
@dorkyboi dorkyboi released this 21 Apr 16:04
· 49 commits to master since this release

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}/>;