Skip to content

Commit

Permalink
docs - added children props to custom child component example (#1817)
Browse files Browse the repository at this point in the history
  • Loading branch information
nissimscialom committed Dec 30, 2022
1 parent b58e1ca commit 89bf059
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -556,10 +556,11 @@ If you use React Components as grid children, they need to do a few things:
For example:
```js
const CustomGridItemComponent = React.forwardRef(({style, className, onMouseDown, onMouseUp, onTouchEnd, ...props}, ref) => {
const CustomGridItemComponent = React.forwardRef(({style, className, onMouseDown, onMouseUp, onTouchEnd, children, ...props}, ref) => {
return (
<div style={{ /* styles */, ...style}} className={className} ref={ref} onMouseDown={onMouseDown} onMouseUp={onMouseUp} onTouchEnd={onTouchEnd}>
{/* Some other content */}
{children} {/* Make sure to include children to add resizable handle */}
</div>
);
}
Expand Down

0 comments on commit 89bf059

Please sign in to comment.