diff --git a/README.md b/README.md index 7d15477be..d024c3f64 100644 --- a/README.md +++ b/README.md @@ -355,7 +355,10 @@ onResize: ItemCallback, // Calls when resize is complete. onResizeStop: ItemCallback, // Calls when some element has been dropped -onDrop: (elemParams: { x: number, y: number, w: number, h: number, e: Event }) => void +onDrop: (elemParams: { x: number, y: number, w: number, h: number, e: Event }) => void, + +// Ref for getting a reference for the wrapping div. +innerRef: ?React.Ref ``` ### Responsive Grid Layout Props diff --git a/lib/ReactGridLayout.jsx b/lib/ReactGridLayout.jsx index 2b6fb4c3d..ce886fa6e 100644 --- a/lib/ReactGridLayout.jsx +++ b/lib/ReactGridLayout.jsx @@ -683,7 +683,7 @@ export default class ReactGridLayout extends React.Component { }; render() { - const { className, style, isDroppable } = this.props; + const { className, style, isDroppable, innerRef } = this.props; const mergedClassName = classNames(layoutClassName, className); const mergedStyle = { @@ -693,6 +693,7 @@ export default class ReactGridLayout extends React.Component { return (
void, - children: ReactChildrenArray> + children: ReactChildrenArray>, + innerRef?: Ref<"div"> |}; export default { @@ -175,5 +177,8 @@ export default { } keys[child.key] = true; }); - } + }, + + // Optional ref for getting a reference for the wrapping div. + innerRef: PropTypes.any };