MCPcopy Create free account
hub / github.com/flyfloor/react-component / makeCarouselItem

Function makeCarouselItem

component/Carousel.js:73–87  ·  view source on GitHub ↗
(children)

Source from the content-addressed store, hash-verified

71 },
72
73 makeCarouselItem(children){
74 const {baseWidth, index} = this.state;
75 let itemNodes = [];
76
77 let _len = React.Children.count(children);
78
79 for(let i = -1; i <= _len; i++){
80 let _index = i;
81 let active = index === i ? '_active': '';
82 if (_index === -1) _index = _len - 1;
83 if (_index === _len) _index = 0;
84
85 itemNodes.push(<div key={`carousel-item-${i}`}
86 style={{'width': baseWidth}}
87 className={`_item ${active}`}>
88 {children[_index]}
89 </div>);
90 }

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…