Add deprecation notice for React.addons.batchedUpdates
Fixes #4525.
Ben Alpert committed
Aug 24, 2015 at 16:19 UTC
e64b402df9a8e15762cd3ffa54376a532dda582a
1 file changed
+14
-1
src/addons/ReactWithAddons.js
+14
-1
@@ -30,6 +30,9 @@ var ReactUpdates = require('ReactUpdates');
30
var cloneWithProps = require('cloneWithProps');
31
var shallowCompare = require('shallowCompare');
32
var update = require('update');
33
+var warning = require('warning');
34
+
35
+var warnedAboutBatchedUpdates = false;
36
37
React.addons = {
38
CSSTransitionGroup: ReactCSSTransitionGroup,
@@ -37,7 +40,17 @@ React.addons = {
40
PureRenderMixin: ReactComponentWithPureRenderMixin,
41
TransitionGroup: ReactTransitionGroup,
42
40
- batchedUpdates: ReactUpdates.batchedUpdates,
43
+ batchedUpdates: function() {
44
+ if (__DEV__) {
45
+ warning(
46
+ warnedAboutBatchedUpdates,
47
+ 'React.addons.batchedUpdates is deprecated. Use ' +
48
+ 'ReactDOM.unstable_batchedUpdates instead.'
49
+ );
50
+ warnedAboutBatchedUpdates = true;
51
+ }
52
+ return ReactUpdates.batchedUpdates.apply(this, arguments);
53
+ },
54
cloneWithProps: cloneWithProps,
55
createFragment: ReactFragment.create,
56
shallowCompare: shallowCompare,