React-table: How to access to a row ref?

Created on 4 Aug 2017  路  5Comments  路  Source: tannerlinsley/react-table

I'm trying to access like that
in getTrProps={(params, rowInfo) => {}}

                onClick: () => {
                  this.someFunction(rowInfo, params.TableComponent);  // or params.TableComponent() or blabla
                }

and got different errors.
I need to get tr ref in onClick and pass it. (I want to release "scroll to row" functionality)
so I need ref to call scrollIntoView()

Most helpful comment

Is there a proposed solution to this which is not a workaround?

All 5 comments

I'v found very rough "solution"

in return set id: 'someId' and then in function use document.getElementById('someId') to get node.

But I still looking to more react-style solution

Yeah, I'm not sure exactly how this would work. We would probably need to build in the capability to use a ref in getProps somehow. For now your solution is probably the best way to go about it.

Just wanted to +1 this, I have the exact same use case as @Kimel1. Thanks for the workaround @Kimel1 !

We also ran into this issue - +1 for a non-document related fix if it's possible.

Is there a proposed solution to this which is not a workaround?

Was this page helpful?
0 / 5 - 0 ratings