mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
[React] remove deprecated Component.update()
Summary: Since grepping for `update` and `updateAll` is pretty hard, I had these these functions call through but complain loudly. This noisy call through has been in prod for over a week and I haven't heard any complains, so let's take it out altogether.
This commit is contained in:
1 parent
153fd9246e
commit
36d8ce8fab
1 file changed
-20
@@ -480,24 +480,4 @@ var ReactComponent = {
|
||||
|
||||
};
|
||||
|
||||
function logDeprecated(msg) {
|
||||
if (__DEV__) {
|
||||
throw new Error(msg);
|
||||
} else {
|
||||
console && console.warn && console.warn(msg);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
ReactComponent.Mixin.update = function(props) {
|
||||
logDeprecated('this.update() is deprecated. Use this.setProps()');
|
||||
this.setProps(props);
|
||||
};
|
||||
ReactComponent.Mixin.updateAll = function(props) {
|
||||
logDeprecated('this.updateAll() is deprecated. Use this.replaceProps()');
|
||||
this.replaceProps(props);
|
||||
};
|
||||
|
||||
module.exports = ReactComponent;
|
||||
Reference in new issue
Block a user