MCPcopy Index your code
hub / github.com/reactstrap/reactstrap / render

Method render

src/CarouselItem.js:57–108  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

55 }
56
57 render() {
58 const {
59 in: isIn,
60 children,
61 cssModule,
62 slide = true,
63 tag: Tag = 'div',
64 className,
65 ...transitionProps
66 } = this.props;
67
68 return (
69 <Transition
70 {...transitionProps}
71 enter={slide}
72 exit={slide}
73 in={isIn}
74 onEnter={this.onEnter}
75 onEntering={this.onEntering}
76 onExit={this.onExit}
77 onExiting={this.onExiting}
78 onExited={this.onExited}
79 >
80 {(status) => {
81 const { direction } = this.context;
82 const isActive =
83 status === TransitionStatuses.ENTERED ||
84 status === TransitionStatuses.EXITING;
85 const directionClassName =
86 (status === TransitionStatuses.ENTERING ||
87 status === TransitionStatuses.EXITING) &&
88 this.state.startAnimation &&
89 (direction === 'end' ? 'carousel-item-start' : 'carousel-item-end');
90 const orderClassName =
91 status === TransitionStatuses.ENTERING &&
92 (direction === 'end' ? 'carousel-item-next' : 'carousel-item-prev');
93 const itemClasses = mapToCssModules(
94 classNames(
95 className,
96 'carousel-item',
97 isActive && 'active',
98 directionClassName,
99 orderClassName,
100 ),
101 cssModule,
102 );
103
104 return <Tag className={itemClasses}>{children}</Tag>;
105 }}
106 </Transition>
107 );
108 }
109}
110
111CarouselItem.propTypes = {

Callers

nothing calls this directly

Calls 1

mapToCssModulesFunction · 0.90

Tested by

no test coverage detected