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.
This commit is contained in:
Brandon Dail
2017-04-13 11:07:09 -07:00
committed by Flarnie Marchan
parent e78b192e14
commit 8a011282a0
+19 -7
View File
@@ -37,20 +37,35 @@ if (__DEV__) {
}
var __spread = Object.assign;
var createMixin = function(mixin) {
return mixin;
};
if (__DEV__) {
var warned = false;
var warnedForSpread = false;
var warnedForCreateMixin = false;
__spread = function() {
warning(
warned,
warnedForSpread,
'React.__spread is deprecated and should not be used. Use ' +
'Object.assign directly or another helper function with similar ' +
'semantics. You may be seeing this warning due to your compiler. ' +
'See https://fb.me/react-spread-deprecation for more details.'
);
warned = true;
warnedForSpread = true;
return Object.assign.apply(null, arguments);
};
createMixin = function(mixin) {
warning(
warnedForCreateMixin,
'React.createMixin is deprecated and should not be used. You ' +
'can use your mixin directly instead.'
);
warnedForCreateMixin = true;
return mixin;
};
}
var React = {
@@ -77,10 +92,7 @@ var React = {
PropTypes: ReactPropTypes,
createClass: ReactClass.createClass,
createFactory: createFactory,
createMixin: function(mixin) {
// Currently a noop. Will be used to validate and trace mixins.
return mixin;
},
createMixin: createMixin,
// This looks DOM specific but these are actually isomorphic helpers
// since they are just generating DOM strings.