Skip to content

Commit

Permalink
Pass props to DragLayer (#979)
Browse files Browse the repository at this point in the history
  • Loading branch information
casr authored and darthtrevino committed Mar 21, 2018
1 parent 60ee308 commit 7b1e169
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/01 Top Level API/DragLayer.md
Expand Up @@ -49,7 +49,7 @@ export default class CustomDragLayer {

### Parameters

* **`collect`**: Required. The collecting function. It should return a plain object of the props to inject into your component. It receives a single `monitor` parameter. Read the [overview](docs-overview.html) for an introduction to the monitors and the collecting function. See the collecting function described in detail in the next section.
* **`collect`**: Required. The collecting function. It should return a plain object of the props to inject into your component. It receives two parameters, `monitor` and `props`. Read the [overview](docs-overview.html) for an introduction to the monitors and the collecting function. See the collecting function described in detail in the next section.

* **`options`**: Optional. A plain object. If some of the props to your component are not scalar (that is, are not primitive values or functions), specifying a custom `arePropsEqual(props, otherProps)` function inside the `options` object can improve the performance. Unless you have performance problems, don't worry about it.

Expand Down
2 changes: 1 addition & 1 deletion packages/react-dnd/src/DragLayer.js
Expand Up @@ -102,7 +102,7 @@ export default function DragLayer(collect, options = {}) {

getCurrentState() {
const monitor = this.manager.getMonitor()
return collect(monitor)
return collect(monitor, this.props)
}

render() {
Expand Down

0 comments on commit 7b1e169

Please sign in to comment.