@@ -87,6 +87,10 @@ export default class Draggable extends React.Component {
8787 PropTypes . oneOf ( [ false ] )
8888 ] ) ,
8989
90+ defaultClassName : PropTypes . string ,
91+ defaultClassNameDragging : PropTypes . string ,
92+ defaultClassNameDragged : PropTypes . string ,
93+
9094 /**
9195 * `defaultPosition` specifies the x and y that the dragged item should start at
9296 *
@@ -146,6 +150,9 @@ export default class Draggable extends React.Component {
146150 ...DraggableCore . defaultProps ,
147151 axis : 'both' ,
148152 bounds : false ,
153+ defaultClassName : 'react-draggable' ,
154+ defaultClassNameDragging : 'react-draggable-dragging' ,
155+ defaultClassNameDragged : 'react-draggable-dragged' ,
149156 defaultPosition : { x : 0 , y : 0 } ,
150157 position : null
151158 } ;
@@ -319,10 +326,16 @@ export default class Draggable extends React.Component {
319326 style = createCSSTransform ( transformOpts ) ;
320327 }
321328
329+ const {
330+ defaultClassName,
331+ defaultClassNameDragging,
332+ defaultClassNameDragged
333+ } = this . props ;
334+
322335 // Mark with class while dragging
323- const className = classNames ( ( this . props . children . props . className || '' ) , 'react-draggable' , {
324- 'react-draggable-dragging' : this . state . dragging ,
325- 'react-draggable-dragged' : this . state . dragged
336+ const className = classNames ( ( this . props . children . props . className || '' ) , defaultClassName , {
337+ [ defaultClassNameDragging ] : this . state . dragging ,
338+ [ defaultClassNameDragged ] : this . state . dragged
326339 } ) ;
327340
328341 // Reuse the child provided
0 commit comments