Mui-datatables: Failed prop type: Invalid prop `isRowSelectable` of type `boolean` supplied to `TableSelectCell`, expected `function`.

Created on 11 Dec 2020  路  8Comments  路  Source: gregnb/mui-datatables

When I use your example in console appears error:
image

Expected Behavior


Console without errors

Current Behavior


"Warning: Failed prop type: Invalid prop isRowSelectable of type boolean supplied to TableSelectCell, expected function." appears in console

Steps to Reproduce (for bugs)

  1. npm install mui-datatables --save
  2. npm install @material-ui/core
  3. npm install @material-ui/icons
  4. adding simple table
    image

Your Environment

| Tech | Version |
|--------------|---------|
| Material-UI | 4.11.2 |
| MUI-datatables | 3.7.2 |
| React | 17.0.1 |
| browser | Chrome, Mozilla |
| etc | |

bug

Most helpful comment

@lounsbrough @scarabcoder

Thanks!

Looking at the code, in TableSelectCell it should be set to Boolean.
The reason it is different from the document is that TableSelectCell is an internally used component.

This problem will be resolved in 3.7.3.

All 8 comments

We are having the same issue as of version 3.7.2

@tynindima - I have a PR up that should resolve this since it's causing issues for us as well.

I'm getting this issue with the latest version as well.
I don't know if it's related, but I'm getting this error immediately before it:
image

@lounsbrough Shouldn't it be a function though, and it's just being set to a bool incorrectly?

Yeah could be, not sure which is the expected behavior, but currently sibling components are providing booleans.

Yeah could be, not sure which is the expected behavior, but currently sibling components are providing booleans.

I say that because isRowSelectable is in the API documentation as accepting a function. Seems like it should accept either a function or a boolean, but a more correct fix would probably be to supply isRowSelectable with something like () => false

True. I can make that change.

@lounsbrough @scarabcoder

Thanks!

Looking at the code, in TableSelectCell it should be set to Boolean.
The reason it is different from the document is that TableSelectCell is an internally used component.

This problem will be resolved in 3.7.3.

I see @wdh2100 - I just reverted my last commit, I was thinking the same thing but wasn't sure which route was best.

Was this page helpful?
0 / 5 - 0 ratings