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

Updating the material ui to the latest version of @material-ui/core missing the files MuiThemeProvider.js #17900

Closed
vksantoshsunny opened this issue Oct 16, 2019 · 6 comments
Labels
support: question Community support but can be turned into an improvement

Comments

@vksantoshsunny
Copy link

vksantoshsunny commented Oct 16, 2019

I removed my node_modules folder and did a fresh install of the @material-ui/core. Realized that it missed the files MuiThemeProvider.js and MuiThemeProvider.d.ts

I am having compilation problems as this is missing MuiThemeProvider.

Context 🔦

npm install @material-ui/core

run the above command and it installed the version 4.5.1 but it missed the files required for MuiThemeProvider and so my code is having compile problems

Tech Version
Material-UI v4.5.1
React 16.8.6
Browser
TypeScript
etc.
@rahmatrhd
Copy link
Contributor

Can you give an example of how you import the MuiThemeProvider?

@vksantoshsunny
Copy link
Author

vksantoshsunny commented Oct 16, 2019

import MuiThemeProvider from '@material-ui/core/styles/MuiThemeProvider'

And also this just did not happen for me alone. The other developers within the team also faced the problem.

@merceyz
Copy link
Member

merceyz commented Oct 16, 2019

@material-ui/core/styles/MuiThemeProvider is a private file path, import it from:

import { MuiThemeProvider } from '@material-ui/core/styles';

or

import { MuiThemeProvider } from '@material-ui/core';

@oliviertassinari oliviertassinari added the support: question Community support but can be turned into an improvement label Oct 16, 2019
@vksantoshsunny
Copy link
Author

Thank you.

@oliviertassinari
Copy link
Member

oliviertassinari commented Oct 17, 2019

We might want to introduce MuiThemeProvider back with a warning, it would be less disruptive even if people should never import more than 2 levels deep:

  • 1 level deep: @material-ui/core 👍
  • 2 levels deep: @material-ui/core/styles 👍
  • 3 levels deep: @material-ui/core/styles/MuiThemeProvider ❌

Also, as MuiThemeProvider is no longer documented since v4.0.0, we might as well encourage ThemeProvider instead.

@goneale

This comment has been minimized.

@mui mui locked as resolved and limited conversation to collaborators Mar 9, 2020
@mui mui unlocked this conversation Mar 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
support: question Community support but can be turned into an improvement
Projects
None yet
Development

No branches or pull requests

5 participants