Update prettier

This commit is contained in:
Nicolas Gallagher
2017-04-13 19:26:01 -07:00
parent 0863894f40
commit 761c42301d
3 changed files with 27 additions and 21 deletions
+23 -17
View File
@@ -40,25 +40,31 @@ const applyLayout = Component => {
const componentDidUpdate = Component.prototype.componentDidUpdate;
const componentWillUnmount = Component.prototype.componentWillUnmount;
Component.prototype
.componentDidMount = safeOverride(componentDidMount, function componentDidMount() {
this._layoutState = emptyObject;
this._isMounted = true;
this._onLayoutId = guid();
registry[this._onLayoutId] = this;
this._handleLayout();
});
Component.prototype.componentDidMount = safeOverride(
componentDidMount,
function componentDidMount() {
this._layoutState = emptyObject;
this._isMounted = true;
this._onLayoutId = guid();
registry[this._onLayoutId] = this;
this._handleLayout();
}
);
Component.prototype
.componentDidUpdate = safeOverride(componentDidUpdate, function componentDidUpdate() {
this._handleLayout();
});
Component.prototype.componentDidUpdate = safeOverride(
componentDidUpdate,
function componentDidUpdate() {
this._handleLayout();
}
);
Component.prototype
.componentWillUnmount = safeOverride(componentWillUnmount, function componentWillUnmount() {
this._isMounted = false;
delete registry[this._onLayoutId];
});
Component.prototype.componentWillUnmount = safeOverride(
componentWillUnmount,
function componentWillUnmount() {
this._isMounted = false;
delete registry[this._onLayoutId];
}
);
Component.prototype._handleLayout = function() {
const layout = this._layoutState;