Skip to content

Commit 89bf059

Browse files
docs - added children props to custom child component example (react-grid-layout#1817)
1 parent b58e1ca commit 89bf059

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Diff for: README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -556,10 +556,11 @@ If you use React Components as grid children, they need to do a few things:
556556
For example:
557557
558558
```js
559-
const CustomGridItemComponent = React.forwardRef(({style, className, onMouseDown, onMouseUp, onTouchEnd, ...props}, ref) => {
559+
const CustomGridItemComponent = React.forwardRef(({style, className, onMouseDown, onMouseUp, onTouchEnd, children, ...props}, ref) => {
560560
return (
561561
<div style={{ /* styles */, ...style}} className={className} ref={ref} onMouseDown={onMouseDown} onMouseUp={onMouseUp} onTouchEnd={onTouchEnd}>
562562
{/* Some other content */}
563+
{children} {/* Make sure to include children to add resizable handle */}
563564
</div>
564565
);
565566
}

0 commit comments

Comments
 (0)