Skip to content

Commit

Permalink
Removed the calcWidth in willMount for TextField
Browse files Browse the repository at this point in the history
There is no point in doing the willMount checl for resizing width and
should wait until fully mounted to have access to the DOM nodes anyways.
  • Loading branch information
mlaursen committed Sep 22, 2017
1 parent f1cf194 commit a20bab4
Showing 1 changed file with 0 additions and 10 deletions.
10 changes: 0 additions & 10 deletions src/js/TextFields/TextField.js
Expand Up @@ -403,16 +403,6 @@ export default class TextField extends PureComponent {
};
}

componentWillMount() {
const { value, defaultValue, resize } = this.props;
const v = typeof value !== 'undefined' ? value : defaultValue;
if (!resize || typeof document === 'undefined' || !v) {
return;
}

this.setState({ width: this._calcWidth(v) });
}

componentDidMount() {
const { value, defaultValue, resize } = this.props;
const v = typeof value !== 'undefined' ? value : defaultValue;
Expand Down

0 comments on commit a20bab4

Please sign in to comment.