The library for web and native user interfaces.
Remove references to React.autoBind
Cleaned up a comment and removed a useless test.
Paul O'Shannessy committed
Jul 11, 2013 at 18:42 UTC
cf83fbe397cd7a7a742f5661a9eda3c51416af84
3 files changed
+3
-38
src/core/ReactOwner.js
+2
-2
@@ -37,9 +37,9 @@ var invariant = require('invariant');
37
* </div>
38
* );
39
* },
40
- * handleClick: React.autoBind(function() {
40
+ * handleClick: function() {
41
* this.refs.custom.handleClick();
42
- * }),
42
+ * },
43
* componentDidMount: function() {
44
* this.refs.custom.initialize();
45
* }
src/core/__tests__/ReactBind-test.js
+1
-1
@@ -26,7 +26,7 @@ var ReactTestUtils = require('ReactTestUtils');
26
var reactComponentExpect = require('reactComponentExpect');
27
28
// TODO: Test render and all stock methods.
29
-describe('React.autoBind', function() {
29
+describe('autobinding', function() {
30
31
it('Holds reference to instance', function() {
32
src/core/__tests__/ReactCompositeComponent-test.js
-35
@@ -20,7 +20,6 @@
20
"use strict";
21
22
var MorphingComponent;
23
-var MorphingAutoBindComponent;
23
var ChildUpdates;
24
var React;
25
var ReactCurrentOwner;
@@ -61,22 +60,6 @@ describe('ReactCompositeComponent', function() {
60
}
61
});
62
64
- MorphingAutoBindComponent = React.createClass({
65
- getInitialState: function() {
66
- return {activated: false};
67
- },
68
-
69
- _toggleActivatedState:function() {
70
- this.setState({activated: !this.state.activated});
71
- },
72
-
73
- render: function() {
74
- return !this.state.activated ?
75
- <a ref="x" onClick={this._toggleActivatedState} /> :
76
- <b ref="x" onClick={this._toggleActivatedState} />;
77
- }
78
- });
79
-
63
/**
64
* We'll use this to ensure that an old version is not cached when it is
65
* reallocated again.
@@ -138,24 +121,6 @@ describe('ReactCompositeComponent', function() {
121
reactComponentExpect(instance.refs.x).toBeDOMComponentWithTag('a');
122
});
123
141
- it('should behave the same with React.autoBind', function() {
142
- var instance = <MorphingAutoBindComponent />;
143
- ReactTestUtils.renderIntoDocument(instance);
144
-
145
- reactComponentExpect(instance)
146
- .expectRenderedChild()
147
- .toBeDOMComponentWithTag('a');
148
-
149
- var renderedChild = reactComponentExpect(instance)
150
- .expectRenderedChild()
151
- .instance();
152
-
153
- ReactTestUtils.Simulate.click(renderedChild);
154
- reactComponentExpect(instance)
155
- .expectRenderedChild()
156
- .toBeDOMComponentWithTag('b');
157
- });
158
-
124
it('should not cache old DOM nodes when switching constructors', function() {
125
var instance = <ChildUpdates renderAnchor={true} anchorClassOn={false}/>;
126
ReactTestUtils.renderIntoDocument(instance);