Skip to content

Commit b58e1ca

Browse files
authored
docs: add missing props to custom child example (react-grid-layout#1751)
1 parent 2e1387b commit b58e1ca

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -551,14 +551,14 @@ Because the `children` prop doesn't change between rerenders, updates to `<MyGri
551551
If you use React Components as grid children, they need to do a few things:
552552
553553
1. Forward refs to an underlying DOM node, and
554-
2. Forward `style` and `className` to that same DOM node.
554+
2. Forward `style`,`className`, `onMouseDown`, `onMouseUp` and `onTouchEnd` to that same DOM node.
555555
556556
For example:
557557
558558
```js
559-
const CustomGridItemComponent = React.forwardRef(({style, className, ...props}, ref) => {
559+
const CustomGridItemComponent = React.forwardRef(({style, className, onMouseDown, onMouseUp, onTouchEnd, ...props}, ref) => {
560560
return (
561-
<div style={{ /* styles */, ...style}} className={className} ref={ref}>
561+
<div style={{ /* styles */, ...style}} className={className} ref={ref} onMouseDown={onMouseDown} onMouseUp={onMouseUp} onTouchEnd={onTouchEnd}>
562562
{/* Some other content */}
563563
</div>
564564
);

0 commit comments

Comments
 (0)