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

[legacy-framework] createMuiTheme deprecation update #2844

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions recipes/material-ui/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,11 +190,11 @@ This will let the next.js app opt out of the React.Strict mode wrapping. Once yo
explanation: `We will import the ThemeProvider into _app and the CssBaseline component for easy and consistent usage of the @material-ui components. We will also customize the _app component to be remove the server side injected CSS.`,
singleFileSearch: paths.app(),
transform(program) {
// import ThemeProvider and createMuiTheme
// import ThemeProvider and createTheme
const themeImport = j.importDeclaration(
[
j.importSpecifier(j.identifier("ThemeProvider")),
j.importSpecifier(j.identifier("createMuiTheme")),
j.importSpecifier(j.identifier("createTheme")),
],
j.literal("@material-ui/core/styles"),
)
Expand All @@ -214,7 +214,7 @@ This will let the next.js app opt out of the React.Strict mode wrapping. Once yo
const theme = j.variableDeclaration("const", [
j.variableDeclarator(
j.identifier("theme"),
j.callExpression(j.identifier("createMuiTheme"), [
j.callExpression(j.identifier("createTheme"), [
j.objectExpression([
j.objectProperty(
j.identifier("palette"),
Expand Down