diff --git a/src/renderers/shared/reconciler/__tests__/ReactCompositeComponent-test.js b/src/renderers/shared/reconciler/__tests__/ReactCompositeComponent-test.js index 9f3cf74dd5..f500645d77 100644 --- a/src/renderers/shared/reconciler/__tests__/ReactCompositeComponent-test.js +++ b/src/renderers/shared/reconciler/__tests__/ReactCompositeComponent-test.js @@ -1242,17 +1242,11 @@ describe('ReactCompositeComponent', function() { }); it('should not overwrite mutated properties', function() { - function Moo(props) { - React.Component.call(this, props); + class Moo extends React.Component { + render() { + return ; + } } - Moo.prototype = Object.create(React.Component.prototype, { - constructor: { - value: Moo, - }, - }); - Moo.prototype.render = function() { - return ; - }; Moo.defaultProps = { idx: 'moo' }; function Foo(props) { @@ -1270,15 +1264,7 @@ describe('ReactCompositeComponent', function() { }; Foo.defaultProps = { idx: 'foo' }; - function Bar() { - Foo.call(this); - } - - Bar.prototype = Object.create(Foo.prototype, { - constructor: { - value: Bar, - }, - }); + class Bar extends Foo {} Bar.defaultProps = { idx: 'bar' }; var moo = ReactTestUtils.renderIntoDocument();