Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update using-inner-ref.md #926

Merged
merged 1 commit into from
Nov 15, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/guides/using-inner-ref.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ You can then correctly supply the DOM node to a `Draggable` or `Droppable`
)}
</Draggable>
```
> Note, if you are using **styled-components v4** the `innerRef` prop was removed in favor of the [React 16 forwardRef API](https://reactjs.org/docs/forwarding-refs.html). Just use the normal ref prop instead.

⚠️ This approach will cause a `React` warning as we are spreading all of the props of the component onto the DOM node. `{...this.props}` This includes the `innerRef` prop which `React` does not like you adding to an element. So you can set things up like this:

Expand Down