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

Module @material-ui/core has no exported member ThemeProvider #18583

Closed
2 tasks done
dfernandez-asapp opened this issue Nov 26, 2019 · 1 comment
Closed
2 tasks done
Labels
bug 🐛 Something doesn't work typescript

Comments

@dfernandez-asapp
Copy link
Contributor

  • The issue is present in the latest release.
  • I have searched the issues of this repository and believe that this is not a duplicate.

Current Behavior 😯

TypeScript compilation fails with

import { ThemeProvider } from '@material-ui/core'

Because ThemeProvider is not exported. However, ThemeProvider exists in index.js and the same import works with a JavaScript source.

Expected Behavior 🤔

Import should work as in JavaScript

Steps to Reproduce 🕹

See current behavior

Context 🔦

A look into the generated index.d.ts, shows that MuiThemeProvider is exported but ThemeProvider is not. This could be related to #16490 and #16489

The index.js has both.

So far my workaround is to import MuiThemeProvider as ThemeProvider, but it will be good to allow just ThemeProvider to match the docs.

Your Environment 🌎

Tech Version
Material-UI v4.7.0
React v16.12
TypeScript v3.7.2
@oliviertassinari oliviertassinari added bug 🐛 Something doesn't work typescript labels Nov 26, 2019
@oliviertassinari
Copy link
Member

oliviertassinari commented Nov 26, 2019

Thanks for the issue. As far as I can see, it will be solved in the next release, with #16490. Do you confirm?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work typescript
Projects
None yet
Development

No branches or pull requests

2 participants