text: (window.webpackJsonp=window.webpackJsonp||[]).push([[17],{mZ11:function(e,t,n){"use strict";n.r(t),n.d(t,"_frontmatter",(function(){return b})),n.d(t,"default",(function(){return p}));n("5hJT"),n("W1QL"),n("K/PF"),n("t91x"),n("75LO"),n("PJhk"),n("mXGw");var o=n("/FXl"),r=n("TjRS"),a=n("ZFoC"),m=n("KMBU"),c=n("xGbp");n("aD51");function i(){return(i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e}).apply(this,arguments)}var b={};void 0!==b&&b&&b===Object(b)&&Object.isExtensible(b)&&!b.hasOwnProperty("__filemeta")&&Object.defineProperty(b,"__filemeta",{configurable:!0,value:{name:"_frontmatter",filename:"src/docs/mdx/onPrevStart.mdx"}});var s={_frontmatter:b},l=r.a;function p(e){var t,n=e.components,p=function(e,t){if(null==e)return{};var n,o,r={},a=Object.keys(e);for(o=0;o<a.length;o++)n=a[o],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,["components"]);return Object(o.b)(l,i({},s,p,{components:n,mdxType:"MDXLayout"}),Object(o.b)("h1",{id:"onprevstart"},"onPrevStart"),Object(o.b)("h4",{id:"onprevstart-will-pass-both-the-current-and-next-item-object"},Object(o.b)("inlineCode",{parentName:"h4"},"onPrevStart")," will pass both the ",Object(o.b)("strong",{parentName:"h4"},"current")," and ",Object(o.b)("strong",{parentName:"h4"},"next")," ",Object(o.b)("inlineCode",{parentName:"h4"},"item-object"),":"),Object(o.b)("pre",null,Object(o.b)("code",i({parentName:"pre"},{}),"(currentItem, nextItem) => {/*...*/}\n")),Object(o.b)("ul",null,Object(o.b)("li",{parentName:"ul"},"The ",Object(o.b)("inlineCode",{parentName:"li"},"item-object")," has the shape of:")),Object(o.b)("pre",null,Object(o.b)("code",i({parentName:"pre"},{}),"{\n    item: {/* your item */},\n    index: // the item's index number \n}\n")),Object(o.b)(a.c,{__position:0,__code:'<Carousel\n  initialFirstItem={3}\n  itemsToShow={2}\n  onPrevStart={(currentItem, nextItem) =>\n    alert(JSON.stringify(currentItem) + `\\n` + JSON.stringify(nextItem))\n  }\n>\n  <Item someProp="cool1">1</Item>\n  <Item someProp="cool2">2</Item>\n  <Item someProp="cool3">3</Item>\n  <Item someProp="cool4">4</Item>\n  <Item someProp="cool5">5</Item>\n  <Item someProp="cool6">6</Item>\n</Carousel>',__scope:(t={props:p,DefaultLayout:r.a,Playground:a.c,Props:a.d,Carousel:m.b,Item:c.a},t.DefaultLayout=r.a,t._frontmatter=b,t),mdxType:"Playground"},Object(o.b)(m.b,{initialFirstItem:3,itemsToShow:2,onPrevStart:function(e,t){return alert(JSON.stringify(e)+"\n"+JSON.stringify(t))},mdxType:"Carousel"},Object(o.b)(c.a,{someProp:"cool1",mdxType:"Item"},"1"),Object(o.b)(c.a,{someProp:"cool2",mdxType:"Item"},"2"),Object(o.b)(c.a,{someProp:"cool3",mdxType:"Item"},"3"),Object(o.b)(c.a,{someProp:"cool4",mdxType:"Item"},"4"),Object(o.b)(c.a,{someProp:"cool5",mdxType:"Item"},"5"),Object(o.b)(c.a,{someProp:"cool6",mdxType:"Item"},"6"))))}p&&p===Object(p)&&Object.isExtensible(p)&&!p.hasOwnProperty("__filemeta")&&Object.defineProperty(p,"__filemeta",{configurable:!0,value:{name:"MDXContent",filename:"src/docs/mdx/onPrevStart.mdx"}}),p.isMDXComponent=!0}}]);
  //# sourceMappingURL=component---src-docs-mdx-on-prev-start-mdx-3843374e128cafa18385.js.map