From cf83fbe397cd7a7a742f5661a9eda3c51416af84 Mon Sep 17 00:00:00 2001 From: Paul O'Shannessy Date: Thu, 11 Jul 2013 18:42:43 -0700 Subject: [PATCH] Remove references to React.autoBind Cleaned up a comment and removed a useless test. --- src/core/ReactOwner.js | 4 +-- src/core/__tests__/ReactBind-test.js | 2 +- .../__tests__/ReactCompositeComponent-test.js | 35 ------------------- 3 files changed, 3 insertions(+), 38 deletions(-) diff --git a/src/core/ReactOwner.js b/src/core/ReactOwner.js index bef0f8c9cf..321389fe55 100644 --- a/src/core/ReactOwner.js +++ b/src/core/ReactOwner.js @@ -37,9 +37,9 @@ var invariant = require('invariant'); * * ); * }, - * handleClick: React.autoBind(function() { + * handleClick: function() { * this.refs.custom.handleClick(); - * }), + * }, * componentDidMount: function() { * this.refs.custom.initialize(); * } diff --git a/src/core/__tests__/ReactBind-test.js b/src/core/__tests__/ReactBind-test.js index 47e77bb9d8..8a0f595b1b 100644 --- a/src/core/__tests__/ReactBind-test.js +++ b/src/core/__tests__/ReactBind-test.js @@ -26,7 +26,7 @@ var ReactTestUtils = require('ReactTestUtils'); var reactComponentExpect = require('reactComponentExpect'); // TODO: Test render and all stock methods. -describe('React.autoBind', function() { +describe('autobinding', function() { it('Holds reference to instance', function() { diff --git a/src/core/__tests__/ReactCompositeComponent-test.js b/src/core/__tests__/ReactCompositeComponent-test.js index b5e70a43dc..28356063ef 100644 --- a/src/core/__tests__/ReactCompositeComponent-test.js +++ b/src/core/__tests__/ReactCompositeComponent-test.js @@ -20,7 +20,6 @@ "use strict"; var MorphingComponent; -var MorphingAutoBindComponent; var ChildUpdates; var React; var ReactCurrentOwner; @@ -61,22 +60,6 @@ describe('ReactCompositeComponent', function() { } }); - MorphingAutoBindComponent = React.createClass({ - getInitialState: function() { - return {activated: false}; - }, - - _toggleActivatedState:function() { - this.setState({activated: !this.state.activated}); - }, - - render: function() { - return !this.state.activated ? - : - ; - } - }); - /** * We'll use this to ensure that an old version is not cached when it is * reallocated again. @@ -138,24 +121,6 @@ describe('ReactCompositeComponent', function() { reactComponentExpect(instance.refs.x).toBeDOMComponentWithTag('a'); }); - it('should behave the same with React.autoBind', function() { - var instance = ; - ReactTestUtils.renderIntoDocument(instance); - - reactComponentExpect(instance) - .expectRenderedChild() - .toBeDOMComponentWithTag('a'); - - var renderedChild = reactComponentExpect(instance) - .expectRenderedChild() - .instance(); - - ReactTestUtils.Simulate.click(renderedChild); - reactComponentExpect(instance) - .expectRenderedChild() - .toBeDOMComponentWithTag('b'); - }); - it('should not cache old DOM nodes when switching constructors', function() { var instance = ; ReactTestUtils.renderIntoDocument(instance);