Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Material UI 4.12.1 warnings #6451

Closed
panfiva opened this issue Jul 20, 2021 · 19 comments
Closed

Material UI 4.12.1 warnings #6451

panfiva opened this issue Jul 20, 2021 · 19 comments
Assignees
Labels

Comments

@panfiva
Copy link

panfiva commented Jul 20, 2021

What you were expecting:
No warnings

What happened instead:
Receive the following warnings after upgrading to MUI 4.12.1

  • Warning: Failed prop type: The prop onExited of ForwardRef(Snackbar) is deprecated. Use the TransitionProps prop instead.
    • This warning is triggered by Notification.tsx
  • Warning: Failed prop type: The prop onChangePage of ForwardRef(TablePagination) is deprecated. Use the onPageChange prop instead. -AND- Warning: Failed prop type: The prop onChangeRowsPerPage of ForwardRef(TablePagination) is deprecated. Use the onRowsPerPageChange prop instead.
    • This warning is triggered by Pagination.tsx
@fzaninotto
Copy link
Member

Hi, and thanks for the report.

These are deprecation warnings that can be ignored as long as you don't use the next major version of material-ui, which is still in beta and has many, many breaking changes. So we're not in a hurry to fix them. We'll probably do that in the next major version of react-admin (v4, not yet started).

The second issue was already reported in #6421

@djhi djhi closed this as completed Jul 22, 2021
@cprater
Copy link

cprater commented Jul 23, 2021

@fzaninotto Excuse my ignorance I've done a bit of googling and still found no answer. How are we able to ignore the deprecation warnings?

@herndlm
Copy link
Contributor

herndlm commented Aug 11, 2021

@fzaninotto would you consider accepting PRs fixing the deprecation warnings?

@fzaninotto
Copy link
Member

Note that this warning only occurs in development. The warning tells that that this feature will be removed in MUI 5.0. Version 5.0 has many breaking changes and is only in beta, and we don't intend to support before react-admin 4.x. In other words, we don't intend to care about MUI 5.x in react-admin 3.x

If they put a deprecation warning for all breaking changes in 4.x, it'll be hell to fix on our side.

As the peerDependency on material-ui is "^4.11.2", fixing this warning this implies that we bump the minimal mui version in our next minor (3.18)

@fzaninotto
Copy link
Member

The funny think is that there is no documentation for version 4.12...

https://material-ui.com/versions/

@davidhenley
Copy link
Contributor

davidhenley commented Sep 14, 2021

Note that this warning only occurs in development

I understand, but that's where we do all our work and when we are looking at the console. They are piling up quickly and are very annoying to search through. Do you have any suggestions for ignoring these?

As the peerDependency on material-ui is "^4.11.2", fixing this warning this implies that we bump the minimal mui version in our next minor (3.18)

So are you saying that this will be fixed in 3.18.2?

EDIT: I see you already have the fix committed. Thanks for all the hard work @fzaninotto!

@whg517
Copy link

whg517 commented Sep 15, 2021

I hope this problem can be fixed as soon as possible, this annoying warning always makes it difficult for me to debug the program. If the Material-UI doesn't provide a good way to control it, I think react-admin should be able to control the version that uses dependencies, rather than having this problem exposed to the user.

@fzaninotto
Copy link
Member

If you don't want the warnings, downgrade the material-ui version you're using, or ask them to allow a global setting to turn the warnings off.

As for react-admin, the next version (3.19) will have these warnings cleared. Release schedules for early October.

@davidhenley
Copy link
Contributor

davidhenley commented Sep 21, 2021

@fzaninotto Can you give instructions on how to downgrade the material-ui for those of us that only take on the dependency of react-admin? You've mentioned this several times but people (ie: @cprater in this thread) have asked how to do so with no answer.

"dependencies": {
    "react": "^17.0.2",
    "react-admin": "^3.18.2",
    "react-dom": "^17.0.2",
    "react-scripts": "4.0.3"
  },

@fzaninotto
Copy link
Member

@davidhenley To force a sub-dependency, you have 2 ways:

  1. add it as a direct dependency. normally, npm/yarn should deduplicate it, and force react-admin to use your version
"dependencies": {
    "react": "^17.0.2",
    "react-admin": "^3.18.2",
    "react-dom": "^17.0.2",
    "react-scripts": "4.0.3",
+   "@material-ui/core": "^4.11.2"
  },
  1. If you're using yarn, you can add a resolutions entry to force a particular version:
"dependencies": {
    "react": "^17.0.2",
    "react-admin": "^3.18.2",
    "react-dom": "^17.0.2",
    "react-scripts": "4.0.3"
},
+"resolutions": {
+   "@material-ui/core": "4.11.2"
+},

@davidhenley
Copy link
Contributor

davidhenley commented Sep 22, 2021

@fzaninotto I added the first way, deleted node_modules and yarn.lock, reinstalled dependencies and still the same issues.

"dependencies": {
    "react": "^17.0.2",
    "react-admin": "3.18.2",
    "react-dom": "^17.0.2",
    "react-scripts": "4.0.3",
    "@material-ui/core": "^4.11.2"
  },

Screen Shot 2021-09-22 at 12 13 20 PM

@herndlm
Copy link
Contributor

herndlm commented Sep 22, 2021

@davidhenley AFAIK you need to stay on 4.11.x to get rid of the warnings right now. As the caret ^ is allowing 4.12.x as well here, smth like ~4.11.0 should work.

@davidhenley
Copy link
Contributor

davidhenley commented Sep 22, 2021

@herndlm hmm...that didn't seem to work. still getting the same deprecation warnings everywhere:

"dependencies": {
    "react": "^17.0.2",
    "react-admin": "3.18.2",
    "react-dom": "^17.0.2",
    "react-scripts": "4.0.3",
    "@material-ui/core": "~4.11.0",
    "@material-ui/icons": "^4.11.2",
  },

@whg517
Copy link

whg517 commented Sep 23, 2021

@davidhenley

I use npm. In my experience, first you need to check the dependent version of @material-ui/core in package-lock.json . If not 4.11.2, uninstall and reinstall npm i @material-ui/core@4.11.2 . And check package-lock.json again. If this still doesn't work, try deleting the node_modules directory and re-running 'npm install'. Only if the version in package-lock.json is confirmed can you confirm that you have installed version 4.11.2.

I know it's an annoying question, but it's the only thing I can do. Recently I saw that Material-UI 5.0 has been released. I hope react-admin will follow suit soon.

Thanks to the community developers for their efforts.

@fzaninotto
Copy link
Member

Since react-admin 3.18 was published and removes these warnings, our fix for this problem is simply to upgrade to the latest react-admin version.

You can avoid it if you know how to fork yarn/npm dependencies, but in that case it's your responsibility to do it.

@davidhenley
Copy link
Contributor

davidhenley commented Sep 23, 2021

@fzaninotto Do you mean 3.19? You said earlier that 3.19 will fix these and it is not published yet. The warnings are still there in 3.18.2

@davidhenley
Copy link
Contributor

@whg517 I did wipe node_modules and reinstalled as stated earlier. They are still there. Hopefully 3.19 will come out soon.

@fzaninotto
Copy link
Member

My bad, these warnings will go away in 3.19.

@djhi djhi closed this as completed in 74f4dfe Oct 4, 2021
@davidhenley
Copy link
Contributor

davidhenley commented Oct 15, 2021

Oh my god the deprecation warnings are gone with 3.19! My happiness has just gone through the roof!

Thanks everyone!!

ogustavo-pereira pushed a commit to ogustavo-pereira/react-admin that referenced this issue Nov 23, 2021
ken1901 pushed a commit to ken1901/react-admin that referenced this issue Feb 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants