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

@mui/styles has inconsistent react types #41841

Open
aParadowski opened this issue Apr 10, 2024 · 0 comments
Open

@mui/styles has inconsistent react types #41841

aParadowski opened this issue Apr 10, 2024 · 0 comments
Assignees
Labels
package: system Specific to @mui/system status: waiting for maintainer These issues haven't been looked at yet by a maintainer

Comments

@aParadowski
Copy link

aParadowski commented Apr 10, 2024

Steps to reproduce

Link to live example: (required)

Steps:

  1. Run npm i in a package using react and @types/react v18+ that also has @mui/styles in the dependency tree

Current behavior

The console prints warnings related to conflicting peer dependencies for react

npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: @mui/styles@5.15.15
npm WARN Found: react@18.2.0
npm WARN node_modules/react
npm WARN   react@"^18.2.0" from the root project
npm WARN   39 more (@ag-grid-community/react, ...)
npm WARN
npm WARN Could not resolve dependency:
npm WARN peer react@"^17.0.0" from @mui/styles@5.15.15
npm WARN node_modules/@InternalPackage/node_modules/@mui/styles
npm WARN   @mui/styles@"^5.15.14" from @InternalPackage
npm WARN   node_modules/@InternalPackage
npm WARN
npm WARN Conflicting peer dependency: react@17.0.2
npm WARN node_modules/react
npm WARN   peer react@"^17.0.0" from @mui/styles@5.15.15
npm WARN   node_modules/@InternalPackage/node_modules/@mui/styles
npm WARN     @mui/styles@"^5.15.14" from @InternalPackage

Expected behavior

There are no console warnings when using react 18.

Context

I understand that @mui/styles does not support react v18 and is deprecated, but the package.json should reflect other MUI packages and include react v18 in the list of supported peer dependencies or the supported react versions should be consistent between the two. Right now supporting @types/react v17 || v18 is not consistent with restricting react access.

Your environment

npx @mui/envinfo

System:
OS: Windows 11 10.0.22631
Binaries:
Node: 18.8.0 - C:\Program Files\nodejs\node.EXE
npm: 9.9.2 - C:\Program Files\nodejs\npm.CMD
pnpm: Not Found
Browsers:
Chrome: Not Found
Edge: Chromium (123.0.2420.81)
npmPackages:
@emotion/react: 11.11.4
@emotion/styled: 11.11.5
@mui/base: 5.0.0-beta.40
@mui/core-downloads-tracker: 5.15.15
@mui/lab: 5.0.0-alpha.170
@mui/material: 5.15.15
@mui/private-theming: 5.15.14
@mui/styled-engine: 5.15.14
@mui/system: 5.15.15
@mui/types: 7.2.14
@mui/utils: 5.15.14
@mui/x-data-grid: 6.19.9
@mui/x-data-grid-pro: 6.19.9
@mui/x-date-pickers: 6.19.9
@mui/x-date-pickers-pro: 6.19.9
@mui/x-license-pro: 6.10.2
@mui/x-tree-view: 6.17.0
@types/react: 18.2.74
react: ^18.2.0 => 18.2.0
react-dom: ^18.2.0 => 18.2.0
typescript: 4.9.5

Search keywords: react, mui/styles, react-types

@aParadowski aParadowski added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Apr 10, 2024
@zannager zannager added the package: system Specific to @mui/system label Apr 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package: system Specific to @mui/system status: waiting for maintainer These issues haven't been looked at yet by a maintainer
Projects
None yet
Development

No branches or pull requests

3 participants