Skip to content

Commit

Permalink
Change ref from strign to arrow func.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredreich committed Jan 31, 2017
1 parent 5064580 commit 275b1a9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
5 changes: 4 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,8 @@ module.exports = {
"plugins": [
"standard",
"promise"
]
],
"rules": {
"react/jsx-no-bind": 0
}
}
8 changes: 4 additions & 4 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,13 @@ class Files extends React.Component {
}

onDragEnter (event) {
let el = this.refs.dropzone
let el = this.dropzone
el.className += ' ' + this.props.dropActiveClassName
}

onDragLeave (event) {
let el = this.refs.dropzone
el.className = el.className.replace(' ' + this.props.dropActiveClassName, '')
let el = this.dropzone
this.dropzone.className = el.className.replace(' ' + this.props.dropActiveClassName, '')
}

openFileChooser () {
Expand Down Expand Up @@ -221,7 +221,7 @@ class Files extends React.Component {
onDragOver={this.onDragOver}
onDragEnter={this.onDragEnter}
onDragLeave={this.onDragLeave}
ref='dropzone'
ref={dropzone => { this.dropzone = dropzone }}
style={this.props.style}
>
{this.props.children}
Expand Down

0 comments on commit 275b1a9

Please sign in to comment.