Skip to content

Commit

Permalink
Add a warning message if user uses a non-integer fontSize
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasguillory committed Nov 9, 2015
1 parent c53edec commit d60cd20
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/text-field.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,13 @@ const TextField = React.createClass({
},

_getFontSize() {
return this.props.style && this.props.style.fontSize ? this.props.style.fontSize : 16;
if (this.props.style && this.props.style.fontSize) {
if (process.env.NODE_ENV !== 'production' && typeof this.props.style.fontSize !== 'number') {
console.warn('style.fontSize property does not support non-integer values');
}
return this.props.style.fontSize;
}
return 16;
},

_getRef() {
Expand Down

0 comments on commit d60cd20

Please sign in to comment.