Skip to content

Commit 4ba3c90

Browse files
committed
Remove react/addons and create className directly. Fixes #42
1 parent ad68dc2 commit 4ba3c90

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

lib/draggable.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
'use strict';
22

33
/** @jsx React.DOM */
4-
var React = require('react/addons');
4+
var React = require('react');
55
var emptyFunction = require('react/lib/emptyFunction');
66
var CX = React.addons.classSet;
77

@@ -446,11 +446,12 @@ module.exports = React.createClass({
446446
if (this.state.dragging && !isNaN(this.props.zIndex)) {
447447
style.zIndex = this.props.zIndex;
448448
}
449-
450-
var className = CX({
451-
'react-draggable': true,
452-
'react-draggable-dragging': this.state.dragging
453-
});
449+
450+
var className = 'react-draggable';
451+
if (this.state.dragging) {
452+
className += ' react-draggable-dragging';
453+
}
454+
454455
// Reuse the child provided
455456
// This makes it flexible to use whatever element is wanted (div, ul, etc)
456457
return React.addons.cloneWithProps(React.Children.only(this.props.children), {

webpack.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ module.exports = {
77
libraryTarget: 'umd'
88
},
99
externals: {
10-
'react/addons': 'React'
10+
'react': 'React'
1111
},
1212
module: {
1313
loaders: [

0 commit comments

Comments
 (0)