Skip to content

Commit

Permalink
Fix link of callback ref (#2906)
Browse files Browse the repository at this point in the history
  • Loading branch information
inokawa committed Jan 4, 2021
1 parent 4841b27 commit cab86e2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/docsite/markdown/docs/00 Quick Start/Overview.md
Expand Up @@ -85,7 +85,7 @@ render() {
}
```

The `connectDropTarget` call tells React DnD that the root DOM node of our component is a valid drop target, and that its hover and drop events should be handled by the backend. Internally it works by attaching a [callback ref](https://facebook.github.io/react/docs/more-about-refs.html#the-ref-callback-attribute) to the React element you gave it. The function returned by the connector is memoized, so it doesn't break the `shouldComponentUpdate` optimizations.
The `connectDropTarget` call tells React DnD that the root DOM node of our component is a valid drop target, and that its hover and drop events should be handled by the backend. Internally it works by attaching a [callback ref](https://reactjs.org/docs/refs-and-the-dom.html#callback-refs) to the React element you gave it. The function returned by the connector is memoized, so it doesn't break the `shouldComponentUpdate` optimizations.

### Drag Sources and Drop Targets

Expand Down
2 changes: 1 addition & 1 deletion packages/react-dnd/src/utils/cloneWithRef.ts
Expand Up @@ -18,7 +18,7 @@ export function cloneWithRef(
typeof previousRef !== 'string',
'Cannot connect React DnD to an element with an existing string ref. ' +
'Please convert it to use a callback ref instead, or wrap it into a <span> or <div>. ' +
'Read more: https://facebook.github.io/react/docs/more-about-refs.html#the-ref-callback-attribute',
'Read more: https://reactjs.org/docs/refs-and-the-dom.html#callback-refs',
)

if (!previousRef) {
Expand Down

0 comments on commit cab86e2

Please sign in to comment.