File tree Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -188,26 +188,28 @@ class SwipeableListItem extends PureComponent {
188
188
}
189
189
} ;
190
190
191
+ bindBackgroundLeft = ref => ( this . backgroundLeft = ref ) ;
192
+ bindBackgroundRight = ref => ( this . backgroundRight = ref ) ;
193
+ bindListElement = ref => ( this . listElement = ref ) ;
194
+ bindWrapper = ref => ( this . wrapper = ref ) ;
195
+
191
196
render ( ) {
192
197
const { children, swipeLeft, swipeRight } = this . props ;
193
198
194
199
return (
195
- < div className = "swipeable-list-item" ref = { div => ( this . wrapper = div ) } >
200
+ < div className = "swipeable-list-item" ref = { this . bindWrapper } >
196
201
{ swipeLeft && (
197
- < div ref = { div => ( this . backgroundLeft = div ) } className = "background" >
202
+ < div ref = { this . bindBackgroundLeft } className = "background" >
198
203
{ swipeLeft . background }
199
204
</ div >
200
205
) }
201
206
{ swipeRight && (
202
- < div
203
- ref = { div => ( this . backgroundRight = div ) }
204
- className = "background right"
205
- >
207
+ < div ref = { this . bindBackgroundRight } className = "background right" >
206
208
{ swipeRight . background }
207
209
</ div >
208
210
) }
209
211
< div
210
- ref = { div => ( this . listElement = div ) }
212
+ ref = { this . bindListElement }
211
213
onMouseDown = { this . onDragStartMouse }
212
214
onTouchStart = { this . onDragStartTouch }
213
215
className = "content"
You can’t perform that action at this time.
0 commit comments