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

Please export ThemeOptions #19773

Closed
1 task done
benwiley4000 opened this issue Feb 19, 2020 · 2 comments
Closed
1 task done

Please export ThemeOptions #19773

benwiley4000 opened this issue Feb 19, 2020 · 2 comments
Labels
good first issue Great for first contributions. Enable to learn the contribution process. new feature New feature or request typescript

Comments

@benwiley4000
Copy link
Contributor

  • I have searched the issues of this repository and believe that this is not a duplicate.

Summary 💡

I'm doing this in my code:

import { ThemeOptions } from "@material-ui/core/styles/createMuiTheme";

Seems like my import path could be less fragile if we export ThemeOptions from a higher level, hopefully at the top.

Examples 🌈

import { ThemeOptions } from "@material-ui/core";

Motivation 🔦

Just nicer code that doesn't risk breaking when there's an update to the dependency.

@eps1lon eps1lon added new feature New feature or request good first issue Great for first contributions. Enable to learn the contribution process. typescript labels Feb 19, 2020
@oliviertassinari
Copy link
Member

If we can update the documentation, it would probaby be great too:

diff --git a/docs/src/pages/guides/typescript/typescript.md b/docs/src/pages/guides/typescript/typescript.md
index c2b1255eb..8371737e4 100644
--- a/docs/src/pages/guides/typescript/typescript.md
+++ b/docs/src/pages/guides/typescript/typescript.md
@@ -242,8 +242,7 @@ And a custom theme factory with additional defaulted options:

 **./styles/createMyTheme**:
 ```ts
-import { createMuiTheme } from '@material-ui/core/styles';
-import { ThemeOptions } from '@material-ui/core/styles/createMuiTheme';
+import { createMuiTheme, ThemeOptions } from '@material-ui/core/styles';

 export default function createMyTheme(options: ThemeOptions) {
   return createMuiTheme({

@oliviertassinari
Copy link
Member

Solved by #19789

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Great for first contributions. Enable to learn the contribution process. new feature New feature or request typescript
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants