I'm new to React and I'm trying to sort two React Table instances simultaneously. I have searched all over the place, but I haven't found anything about it so far.
Simplified scenario for the setup. Both tables have the same columns but different data. If I sort for example 'total' in left table, how can I sort the same column in right table at the same time?
function App() {
...
return (
<div>
<div className="left-table">
<Table columns={columns} data={data1} />
</div>
<div className="right-table">
<Table columns={columns} data={data2} />
</div>
</div>
);
}
EDIT
For now it seems that the best way to achieve what I want, is to create buttons/checkboxes that determine which columns need to be sorted and pass that info to the table component(s) and use setSortBy there.