@samitouri / QOS-React / commits / 77c7792556

Remove React.__spread

Toru Kobayashi committed Feb 7, 2017 at 14:22 UTC 77c7792556e4697636d1eb5dc34042566185c26c
3 files changed -26
scripts/fiber/tests-passing.txt
-1
@@ -111,7 +111,6 @@ src/addons/transitions/__tests__/ReactTransitionGroup-test.js
111 * should warn for duplicated keys
112
113 src/isomorphic/__tests__/React-test.js
114 -* should log a deprecation warning once when using React.__spread
114 * should log a deprecation warning once when using React.createMixin
115
116 src/isomorphic/children/__tests__/ReactChildren-test.js
src/isomorphic/React.js
-15
@@ -33,25 +33,12 @@ if (__DEV__) {
33 cloneElement = ReactElementValidator.cloneElement;
34 }
35
36 -var __spread = Object.assign;
36 var createMixin = function(mixin) {
37 return mixin;
38 };
39
40 if (__DEV__) {
42 - var warnedForSpread = false;
41 var warnedForCreateMixin = false;
44 - __spread = function() {
45 - warning(
46 - warnedForSpread,
47 - 'React.__spread is deprecated and should not be used. Use ' +
48 - 'Object.assign directly or another helper function with similar ' +
49 - 'semantics. You may be seeing this warning due to your compiler. ' +
50 - 'See https://fb.me/react-spread-deprecation for more details.'
51 - );
52 - warnedForSpread = true;
53 - return Object.assign.apply(null, arguments);
54 - };
42
43 createMixin = function(mixin) {
44 warning(
@@ -97,8 +84,6 @@ var React = {
84
85 version: ReactVersion,
86
100 - // Deprecated hook for JSX spread, don't use this for anything.
101 - __spread: __spread,
87 };
88
89 module.exports = React;
src/isomorphic/__tests__/React-test.js
-10
@@ -19,16 +19,6 @@ describe('React', () => {
19 React = require('React');
20 });
21
22 - it('should log a deprecation warning once when using React.__spread', () => {
23 - spyOn(console, 'error');
24 - React.__spread({});
25 - React.__spread({});
26 - expectDev(console.error.calls.count()).toBe(1);
27 - expectDev(console.error.calls.argsFor(0)[0]).toContain(
28 - 'React.__spread is deprecated and should not be used'
29 - );
30 - });
31 -
22 it('should log a deprecation warning once when using React.createMixin', () => {
23 spyOn(console, 'error');
24 React.createMixin();