@samitouri / QOS-React-2 / commits / 2b7814f713

Deprecate React.createMixin

This API was never fully implemented. Since mixins are no longer considered part of the future React API, it will be removed.

Brandon Dail committed Jan 23, 2017 at 18:05 UTC 2b7814f713629d3f629ea9d74f349b77369fdae3
1 file changed +19 -7
src/isomorphic/React.js
+19 -7
@@ -35,20 +35,35 @@ if (__DEV__) {
35 }
36
37 var __spread = Object.assign;
38 +var createMixin = function(mixin) {
39 + return mixin;
40 +};
41
42 if (__DEV__) {
40 - var warned = false;
43 + var warnedForSpread = false;
44 + var warnedForCreateMixin = false;
45 __spread = function() {
46 warning(
43 - warned,
47 + warnedForSpread,
48 'React.__spread is deprecated and should not be used. Use ' +
49 'Object.assign directly or another helper function with similar ' +
50 'semantics. You may be seeing this warning due to your compiler. ' +
51 'See https://fb.me/react-spread-deprecation for more details.'
52 );
49 - warned = true;
53 + warnedForSpread = true;
54 return Object.assign.apply(null, arguments);
55 };
56 +
57 + createMixin = function(mixin) {
58 + warning(
59 + warnedForCreateMixin,
60 + 'React.createMixin is deprecated and should not be used. You ' +
61 + 'can use your mixin directly instead.'
62 + );
63 + warnedForCreateMixin = true;
64 + return mixin;
65 + };
66 +
67 }
68
69 var React = {
@@ -75,10 +90,7 @@ var React = {
90 PropTypes: ReactPropTypes,
91 createClass: ReactClass.createClass,
92 createFactory: createFactory,
78 - createMixin: function(mixin) {
79 - // Currently a noop. Will be used to validate and trace mixins.
80 - return mixin;
81 - },
93 + createMixin: createMixin,
94
95 // This looks DOM specific but these are actually isomorphic helpers
96 // since they are just generating DOM strings.