0
votes

i am using react table and follwed the below links but getting error in selectRow.

`<BootstrapTable
            bootstrap4
            data={data} columns={columns}
            rowEvents={rowEvents}
            options={options}
            selectRow={selectRowProp}
          />`
  `const selectRowProp = {
      mode: 'checkbox',
      showOnlySelected: true,
      selected: true
    };`

and i am getting below error. No overload matches this call. Overload 1 of 2, '(props: Readonly<BootstrapTableProps>): BootstrapTable', gave the following error. Type '{ mode: string; showOnlySelected: boolean; selected: boolean; }' is not assignable to type 'SelectRowProps'. Types of property 'mode' are incompatible. Type 'string' is not assignable to type 'RowSelectionType'. Overload 2 of 2, '(props: BootstrapTableProps, context?: any): BootstrapTable', gave the following error. Type '{ mode: string; showOnlySelected: boolean; selected: boolean; }' is not assignable to type 'SelectRowProps'.ts(2769)

1

1 Answers

0
votes

Try this

import BootstrapTable, { ROW_SELECT_SINGLE, SelectRowProps } from 'react-bootstrap-table-next'
...
const selectRow: SelectRowProps<any> = {
    mode: ROW_SELECT_MULTIPLE,
    showOnlySelected: true,
    selected: true,
}