material-table: Warning: Failed prop type: Invalid prop `actions[0]` supplied to `MaterialTable`.

This error shows up in the console. I have tried to remove each singular line inside of the ‘actions’ but the error only goes away if I remove ‘actions’ itself or everything inside.

This is my ‘actions’ code: actions={[ { icon: Print, tooltip: 'Print', onClick: (event, rowData) => { this.setState({ rowData }) this.handleClickOpen() }, } ]}

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 16 (7 by maintainers)

Commits related to this issue

Most upvoted comments

Try this

icon: () => <Edit/>

I am having same error in Material Table using this

actions={[
                  {
                    icon: "add",
                    isFreeAction: true,
                    onClick: undefined
                  }
                ]}
                components={{
                  Action: props => <NewBin refetch={this.requireRefetch} />
                }}

and this

actions={[
                  {
                    icon: () => <NewBin refetch={this.requireRefetch} />,
                    isFreeAction: true,
                    onClick: undefined
                  }
                ]}

Issued solved. If any one get this error you can try this

actions={[
                  {
                    icon: "add",
                    isFreeAction: true,
                    onClick: () => {}
                  }
                ]}
                components={{
                  Action: props => <NewBin refetch={this.requireRefetch} />
                }}

icon: () => <Edit/>

Thanks, this code is works!

@mbrn
Great ,upgrade to 1.29.1 then resolve this problem, Thank you for your reply!

Will do then 👍

Thank you for your support! Let me know if you would like me to make a PR on it 😃

@mbrn Thanks for looking into this. I recently updated to 1.8 from 1.2, I am not completely sure but I don’t think I had the error in 1.2.