Put deprecation warning for classSet
Also removes the one test that used the module.
Cheng Lou committed
Jan 30, 2015 at 18:47 UTC
835316bc1351dcf4d849a27c44a1a7c1b6f7bda4
2 files changed
+16
-3
src/core/__tests__/ReactCompositeComponent-test.js
+1
-3
@@ -21,14 +21,12 @@ var ReactPropTypes;
21
var ReactServerRendering;
22
var ReactTestUtils;
23
24
-var cx;
24
var reactComponentExpect;
25
var mocks;
26
27
describe('ReactCompositeComponent', function() {
28
29
beforeEach(function() {
31
- cx = require('cx');
30
mocks = require('mocks');
31
32
reactComponentExpect = require('reactComponentExpect');
@@ -66,7 +64,7 @@ describe('ReactCompositeComponent', function() {
64
return this.refs.anch;
65
},
66
render: function() {
69
- var className = cx({'anchorClass': this.props.anchorClassOn});
67
+ var className = this.props.anchorClassOn ? 'anchorClass' : '';
68
return this.props.renderAnchor ?
69
<a ref="anch" className={className}></a> :
70
<b></b>;
src/vendor/stubs/cx.js
+15
@@ -24,7 +24,22 @@
24
* @param [string ...] Variable list of classNames in the string case.
25
* @return string Renderable space-separated CSS className.
26
*/
27
+
28
+'use strict';
29
+var warning = require('warning');
30
+
31
+var warned = false;
32
+
33
function cx(classNames) {
34
+ if (__DEV__) {
35
+ warning(
36
+ warned,
37
+ 'React.addons.classSet will be deprecated in a future version. See ' +
38
+ 'http://fb.me/react-addons-classset'
39
+ );
40
+ warned = true;
41
+ }
42
+
43
if (typeof classNames == 'object') {
44
return Object.keys(classNames).filter(function(className) {
45
return classNames[className];