react-data-table-component

Select row in react-data-table-component how to deactivate multiple select


I'm using react data table component i wanna use a radio button to select a row , i using checkbox how can i deactivate multiple select

 <Table
                    data={data}
                    columns={columns}
                    selectableRows={true}
                    conditionalRowStyles={conditionalRowStyles}
                    onRowClicked={handleRowClicked}
                    onSelectedRowsChange={handleRowSelected}
                    clearSelectedRows={true}
                />

Solution

  • You can use the selectableRowsSingle property.

     <Table
                    data={data}
                    columns={columns}
                    selectableRows={true}
    
                    selectableRowsSingle
    
                    conditionalRowStyles={conditionalRowStyles}
                    onRowClicked={handleRowClicked}
                    onSelectedRowsChange={handleRowSelected}
                    clearSelectedRows={true}
                />