I am new on react, when I am trying to pass data form onSelectionChange property but when I try to apply it the selection of the table stop working
const [selectedRows, setSelectedRows] = React.useState([]);
const handleSetSelectedRows = (e) => {
setSelectedRows(e);
};
...
<MaterialTable
...
onSelectionChange={(e,a)=>{
handleSetSelectedRows(e);
}}
/>
What is the problem?
use useRef instead of useState because it rerender the table
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With