Skip to content

Commit db82ed0

Browse files
committed
Merge pull request #3999 from jimfb/more-context-cleanup
Removed ReactContext (cleanup)
2 parents 1a2a54b + 5ebcd9d commit db82ed0

File tree

3 files changed

+4
-46
lines changed

3 files changed

+4
-46
lines changed

src/isomorphic/classic/__tests__/ReactContextValidator-test.js

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -216,20 +216,16 @@ describe('ReactContextValidator', function() {
216216
});
217217

218218
ReactTestUtils.renderIntoDocument(<Component testContext={{bar: 123}} />);
219-
expect(console.error.argsForCall.length).toBe(2);
219+
expect(console.error.argsForCall.length).toBe(1);
220220
expect(console.error.argsForCall[0][0]).toBe(
221221
'Warning: Failed Context Types: ' +
222222
'Required child context `foo` was not specified in `Component`.'
223223
);
224-
expect(console.error.argsForCall[1][0]).toBe(
225-
'Warning: Failed Context Types: ' +
226-
'Required child context `foo` was not specified in `Component`.'
227-
);
228224

229225
ReactTestUtils.renderIntoDocument(<Component testContext={{foo: 123}} />);
230226

231-
expect(console.error.argsForCall.length).toBe(4);
232-
expect(console.error.argsForCall[3][0]).toBe(
227+
expect(console.error.argsForCall.length).toBe(2);
228+
expect(console.error.argsForCall[1][0]).toBe(
233229
'Warning: Failed Context Types: ' +
234230
'Invalid child context `foo` of type `number` ' +
235231
'supplied to `Component`, expected `string`.'
@@ -244,7 +240,7 @@ describe('ReactContextValidator', function() {
244240
);
245241

246242
// Previous calls should not log errors
247-
expect(console.error.argsForCall.length).toBe(4);
243+
expect(console.error.argsForCall.length).toBe(2);
248244
});
249245

250246
});

src/renderers/shared/reconciler/ReactCompositeComponent.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
'use strict';
1313

1414
var ReactComponentEnvironment = require('ReactComponentEnvironment');
15-
var ReactContext = require('ReactContext');
1615
var ReactCurrentOwner = require('ReactCurrentOwner');
1716
var ReactElement = require('ReactElement');
1817
var ReactElementValidator = require('ReactElementValidator');
@@ -756,16 +755,11 @@ var ReactCompositeComponentMixin = {
756755
*/
757756
_renderValidatedComponent: function() {
758757
var renderedComponent;
759-
var previousContext = ReactContext.current;
760-
ReactContext.current = this._processChildContext(
761-
this._currentElement._context
762-
);
763758
ReactCurrentOwner.current = this;
764759
try {
765760
renderedComponent =
766761
this._renderValidatedComponentWithoutOwnerOrContext();
767762
} finally {
768-
ReactContext.current = previousContext;
769763
ReactCurrentOwner.current = null;
770764
}
771765
invariant(

src/renderers/shared/reconciler/ReactContext.js

Lines changed: 0 additions & 32 deletions
This file was deleted.

0 commit comments

Comments
 (0)