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

Table components should expose innerRef #13492

Closed
2 tasks done
gustavopch opened this issue Nov 2, 2018 · 3 comments
Closed
2 tasks done

Table components should expose innerRef #13492

gustavopch opened this issue Nov 2, 2018 · 3 comments

Comments

@gustavopch
Copy link

gustavopch commented Nov 2, 2018

  • This is not a v0.x issue.
  • I have searched the issues of this repository and believe that this is not a duplicate.

Expected Behavior

Table components (Table, TableBody, TableRow, etc.) should provide innerRef prop exposing the HTMLElement.

Current Behavior

Currently it exposes a ref to a wrapper ReactComponent instead of to the real HTMLElement.

Examples

...
<DragDropContext ...>
  <Droppable ...>
    {provided => (
      <TableBody innerRef={provided.innerRef}>
        ...
      </TableBody>
  </Droppable>
</DragDropContext>
...

Context

Trying to make draggable table rows by using react-beautiful-dnd.

@oliviertassinari
Copy link
Member

You can use the RootRef component or the React.findDOMNode API. In the future, you will be able to provide a ref directly once #10825 is closed.

@OdinSongeThorsen
Copy link

OdinSongeThorsen commented Nov 12, 2018

I've been removing findDomNode from my codebase because of this post by Dan Abramov, and while it does seem like using RootRef works fine, is that just using findDomNode behind the scenes like the example it is based on does?

@oliviertassinari
Copy link
Member

oliviertassinari commented Nov 12, 2018

@Odinsama Yes it's. The React team has recently deprecated the usage of findDOMNode in the strict mode. Check out the linked issue to keep up to date with our progress.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants