From 97b555b37cf069f541ca443dbc5ccaf0b2f33092 Mon Sep 17 00:00:00 2001 From: Sean Keenan Date: Tue, 30 Jun 2020 17:43:12 -0700 Subject: [PATCH] Allow className inDraggable to be set when defining the render function --- src/Draggable.tsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Draggable.tsx b/src/Draggable.tsx index b7e121e..73d8325 100644 --- a/src/Draggable.tsx +++ b/src/Draggable.tsx @@ -17,13 +17,15 @@ class Draggable extends Component { } render() { + const clsName = `${this.props.className ? (this.props.className + ' ') : ''}` + const fullClsName = `${clsName}${wrapperClass}` + if (this.props.render) { - return React.cloneElement(this.props.render(), { className: wrapperClass }); + return React.cloneElement(this.props.render(), { className: fullClsName }); } - const clsName = `${this.props.className ? (this.props.className + ' ') : ''}` return ( -
+
{this.props.children}
);