MCPcopy Create free account
hub / github.com/ElemeFE/element-react / constructor

Method constructor

src/carousel/Carousel.jsx:25–45  ·  view source on GitHub ↗
(props: Object)

Source from the content-addressed store, hash-verified

23 throttledIndicatorHover: (index: number) => void;
24
25 constructor(props: Object) {
26 super(props);
27
28 this.state = {
29 items: [],
30 activeIndex: -1,
31 containerWidth: 0,
32 timer: null,
33 hover: false
34 };
35
36 this.throttledArrowClick = throttle(300, true, index => {
37 this.setActiveItem(index);
38 });
39
40 this.throttledIndicatorHover = throttle(300, index => {
41 this.handleIndicatorHover(index);
42 });
43
44 this.resetItemPosition = this._resetItemPosition.bind(this)
45 }
46
47 getChildContext(): Context {
48 return {

Callers

nothing calls this directly

Calls 2

setActiveItemMethod · 0.95
handleIndicatorHoverMethod · 0.95

Tested by

no test coverage detected