index.js:1 Warning: Failed prop type: The prop `buttonRef` of `ForwardRef(ButtonBase)` is deprecated. Use `ref` instead

Viewed 1689

I´m using MUI Datatables ( V.3.7.8 ), and this error " index.js:1 Warning: Failed prop type: The prop buttonRef of ForwardRef(ButtonBase) is deprecated. Use ref instead. " is appearing..

I can see that when i turn off the search in the MUIDataTable options ( search:false ), the error disappears and i noted that this is related to the Tooltip..

Is this problem already solved? Or somebody else is having the same issue?

Thanks in advance!

1 Answers

I am not using MUIDataTables, but within my MUI webpage I was running into the same issue. I ended up searching my working directory for buttonRef which returned two hits:

  • Widget.js
    • buttonRef={setMoreButtonRef}
  • WidgetView.js
    • buttonRef={props.setMoreButtonRef}

I then read the below page from React which outlines the use of ref in the button component. https://reactjs.org/docs/react-api.html#reactforwardref

So after changing to above lines to:

ref={setMoreButtonRef}
ref={props.setMoreButtonRef}

the error went away.

I would try searching your working directory for buttonRef uses in button components and changing them to ref.

Worked for me.

Related