Skip to content

Commit 51ff5a9

Browse files
committed
Don't pass bad props to underlying DOM element.
Fixes warning in React 15.2.0
1 parent 008375c commit 51ff5a9

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

lib/Resizable.jsx

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -164,22 +164,26 @@ export default class Resizable extends React.Component {
164164
}
165165

166166
render(): React.Element {
167-
let {width, height, ...p} = this.props;
168-
let className = p.className ?
167+
// eslint-disable-next-line no-unused-vars
168+
const {children, draggableOpts, width, height,
169+
handleSize, lockAspectRatio, minConstraints, maxConstraints, onResize,
170+
onResizeStop, onResizeStart, ...p} = this.props;
171+
172+
const className = p.className ?
169173
`${p.className} react-resizable`:
170174
'react-resizable';
171175

172176
// What we're doing here is getting the child of this element, and cloning it with this element's props.
173177
// We are then defining its children as:
174178
// Its original children (resizable's child's children), and
175179
// A draggable handle.
176-
return cloneElement(p.children, {
180+
return cloneElement(children, {
177181
...p,
178182
className,
179183
children: [
180-
p.children.props.children,
184+
children.props.children,
181185
<DraggableCore
182-
{...p.draggableOpts}
186+
{...draggableOpts}
183187
key="resizableHandle"
184188
ref="draggable"
185189
onStop={this.resizeHandler('onResizeStop')}

0 commit comments

Comments
 (0)