Skip to content

Commit

Permalink
Use ES5 function + small jshint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
KyleAMathews committed Jan 6, 2015
1 parent 5b2e262 commit 831f0da
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,19 @@ var TextareaAutosize = React.createClass({

componentDidUpdate: function(prevProps) {
if (
prevProps.style
|| prevProps.value !== this.props.value
|| this.props.value == undefined
prevProps.style ||
prevProps.value !== this.props.value ||
this.props.value === undefined
) {
this.recalculateSize();
}
},

onChange(e) {
onChange: function(e) {
if (this.props.onChange) {
this.props.onChange(e);
}
if (this.props.value == undefined) {
if (this.props.value === undefined) {

This comment has been minimized.

Copy link
@andreypopp

andreypopp Jan 8, 2015

Collaborator

I used == to cover both null and undefined. AFAIK React do the same to activate uncontrolled mode in input/textarea components.

This comment has been minimized.

Copy link
@andreypopp

andreypopp Jan 8, 2015

Collaborator

Should have leave the comment about that.

// controlled mode
this.recalculateSize();
}
Expand Down

0 comments on commit 831f0da

Please sign in to comment.