Skip to content

Commit 47a50a7

Browse files
committed
Replace arrow functions with es5 functions
1 parent a0b8711 commit 47a50a7

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

react-slider.js

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -737,13 +737,16 @@
737737
},
738738

739739
_renderHandle: function (style, child, i) {
740+
var self = this;
740741
var className = this.props.handleClassName + ' ' +
741742
(this.props.handleClassName + '-' + i) + ' ' +
742743
(this.state.index === i ? this.props.handleActiveClassName : '');
743744

744745
return (
745746
React.createElement('div', {
746-
ref: r => (this['handle' + i] = r),
747+
ref: function (r) {
748+
self['handle' + i] = r;
749+
},
747750
key: 'handle' + i,
748751
className: className,
749752
style: style,
@@ -786,10 +789,13 @@
786789
},
787790

788791
_renderBar: function (i, offsetFrom, offsetTo) {
792+
var self = this;
789793
return (
790794
React.createElement('div', {
791795
key: 'bar' + i,
792-
ref: r => (this['bar' + i] = r),
796+
ref: function (r) {
797+
self['bar' + i] = r;
798+
},
793799
className: this.props.barClassName + ' ' + this.props.barClassName + '-' + i,
794800
style: this._buildBarStyle(offsetFrom, this.state.upperBound - offsetTo)
795801
})
@@ -843,6 +849,7 @@
843849
},
844850

845851
render: function () {
852+
var self = this;
846853
var state = this.state;
847854
var props = this.props;
848855

@@ -858,7 +865,9 @@
858865

859866
return (
860867
React.createElement('div', {
861-
ref: r => (this.slider = r),
868+
ref: function (r) {
869+
self.slider = r;
870+
},
862871
style: {position: 'relative'},
863872
className: props.className + (props.disabled ? ' disabled' : ''),
864873
onMouseDown: this._onSliderMouseDown,

0 commit comments

Comments
 (0)