-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
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
[examples] Simplify Next.js example #40661
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,10 +11,10 @@ export const metadata: Metadata = { | |
description: 'Generated by create next app', | ||
}; | ||
|
||
export default function RootLayout({ children }: { children: React.ReactNode }) { | ||
export default function RootLayout(props: { children: React.ReactNode }) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. MUI code style convention |
||
return ( | ||
<html lang="en"> | ||
<body className={inter.className}>{children}</body> | ||
<body className={inter.className}>{props.children}</body> | ||
</html> | ||
); | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,11 +36,11 @@ Inside `app/layout.tsx`, import the `AppRouterCacheProvider` and wrap all elemen | |
// or `v1X-appRouter` if you are using Next.js v1X | ||
|
||
export default function RootLayout(props) { | ||
const { children } = props; | ||
return ( | ||
<html lang="en"> | ||
<body> | ||
+ <AppRouterCacheProvider>{children}</AppRouterCacheProvider> | ||
- {props.children} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. missing |
||
+ <AppRouterCacheProvider>{props.children}</AppRouterCacheProvider> | ||
</body> | ||
</html> | ||
); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
/** @type {import('next').NextConfig} */ | ||
const nextConfig = {}; | ||
|
||
module.exports = nextConfig; | ||
export default nextConfig; | ||
Comment on lines
1
to
+4
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ESM should be the default at this stage, no? It's not what |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
/** @type {import('next').NextConfig} */ | ||
const nextConfig = {}; | ||
|
||
module.exports = nextConfig; | ||
export default nextConfig; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,7 +21,7 @@ export default function App() { | |
return ( | ||
<Container maxWidth="sm"> | ||
<Box sx={{ my: 4 }}> | ||
<Typography variant="h4" component="h1" gutterBottom> | ||
<Typography variant="h4" component="h1" sx={{ mb: 2 }}> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We might not want to promote |
||
Material UI Create React App example with styled-components in TypeScript | ||
</Typography> | ||
<ProTip /> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,7 +13,7 @@ function LightBulbIcon(props: SvgIconProps) { | |
|
||
export default function ProTip() { | ||
return ( | ||
<Typography sx={{ mt: 6, mb: 3 }} color="text.secondary"> | ||
<Typography sx={{ mt: 6, mb: 3, color: 'text.secondary' }}> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Trying to stick to sx prop wherever possible. |
||
<LightBulbIcon sx={{ mr: 1, verticalAlign: 'middle' }} /> | ||
{'Pro tip: See more '} | ||
<Link href="https://mui.com/material-ui/getting-started/templates/">templates</Link> | ||
|
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
/** @type {import('next').NextConfig} */ | ||
const nextConfig = {}; | ||
|
||
export default nextConfig; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Future proof