react-table-example
react-table-example copied to clipboard
OnEdit
How can I access to the selected row after select one row and click onEdit?
@ImBundle did you ever find a way to do this? I'm also seeing issues with the value returned from onEdit doesnt seem to contain the selected rows.
well the onEdit is pretty stubbed out (it passes in a dummy function), but the prototype for onEdit in this example shows that it passes the table instance through to the callback, so you can see what's selected by accessing instance.selectedFlatRows.
I'll add, that this is more of a random example about how to get typescript working with react-table v7 - it's very limited, intentionally.
@ggascoigne hey thanks for the reply. I still must be missing something. Just dumping the returned value from your dummy function im not seeing .selectedFlatRows. See screenshot of console for this.

nvm I figured this out. The value returned by the first callback was hidden by the second due to they are both named a :(
Thanks for the help on this Guy!
I am having the same problem with using onAdd and onEdit and I am not seeing instance.selectedFlatRows in the dump either. Any help would be greatly appreciated.
Take a look at https://github.com/ggascoigne/react-table-example/commit/7080fba2ffbaa7e6675a4ee723fd85a734853a6e, it should make things clearer. Note that I was in a hurry so all it does is log to the console.
Thanks, It helped a lot !