Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v16] Remove React.__spread #8942

Merged
merged 1 commit into from
Feb 10, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion scripts/fiber/tests-passing.txt
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ src/addons/transitions/__tests__/ReactTransitionGroup-test.js
* should warn for duplicated keys

src/isomorphic/__tests__/React-test.js
* should log a deprecation warning once when using React.__spread
* should log a deprecation warning once when using React.createMixin

src/isomorphic/children/__tests__/ReactChildren-test.js
Expand Down
15 changes: 0 additions & 15 deletions src/isomorphic/React.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,25 +33,12 @@ if (__DEV__) {
cloneElement = ReactElementValidator.cloneElement;
}

var __spread = Object.assign;
var createMixin = function(mixin) {
return mixin;
};

if (__DEV__) {
var warnedForSpread = false;
var warnedForCreateMixin = false;
__spread = function() {
warning(
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.'
);
warnedForSpread = true;
return Object.assign.apply(null, arguments);
};

createMixin = function(mixin) {
warning(
Expand Down Expand Up @@ -97,8 +84,6 @@ var React = {

version: ReactVersion,

// Deprecated hook for JSX spread, don't use this for anything.
__spread: __spread,
};

module.exports = React;
10 changes: 0 additions & 10 deletions src/isomorphic/__tests__/React-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,6 @@ describe('React', () => {
React = require('React');
});

it('should log a deprecation warning once when using React.__spread', () => {
spyOn(console, 'error');
React.__spread({});
React.__spread({});
expectDev(console.error.calls.count()).toBe(1);
expectDev(console.error.calls.argsFor(0)[0]).toContain(
'React.__spread is deprecated and should not be used'
);
});

it('should log a deprecation warning once when using React.createMixin', () => {
spyOn(console, 'error');
React.createMixin();
Expand Down