Skip to content

Commit

Permalink
[examples] Fix next.js AMP support (mui#20463)
Browse files Browse the repository at this point in the history
  • Loading branch information
timneutkens authored Apr 8, 2020
1 parent be264e7 commit cc3b03b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions docs/pages/_document.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import { ServerStyleSheets } from '@material-ui/styles';
import Document, { Head, Main, NextScript } from 'next/document';
import Document, { Html, Head, Main, NextScript } from 'next/document';
import { rewriteUrlForNextExport } from 'next/dist/next-server/lib/router/rewrite-url-for-export';
import { LANGUAGES_SSR } from 'docs/src/modules/constants';
import { pathnameToLanguage } from 'docs/src/modules/utils/helpers';
Expand Down Expand Up @@ -33,7 +33,7 @@ export default class MyDocument extends Document {
const { canonical, userLanguage } = this.props;

return (
<html lang={userLanguage}>
<Html lang={userLanguage}>
<Head>
{/*
manifest.json provides metadata used when your web app is added to the
Expand Down Expand Up @@ -92,7 +92,7 @@ export default class MyDocument extends Document {
/>
<NextScript />
</body>
</html>
</Html>
);
}
}
Expand Down
6 changes: 3 additions & 3 deletions examples/nextjs-with-typescript/pages/_document.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import React from 'react';
import Document, { Head, Main, NextScript } from 'next/document';
import Document, { Html, Head, Main, NextScript } from 'next/document';
import { ServerStyleSheets } from '@material-ui/core/styles';
import theme from '../src/theme';

export default class MyDocument extends Document {
render() {
return (
<html lang="en">
<Html lang="en">
<Head>
{/* PWA primary color */}
<meta name="theme-color" content={theme.palette.primary.main} />
Expand All @@ -19,7 +19,7 @@ export default class MyDocument extends Document {
<Main />
<NextScript />
</body>
</html>
</Html>
);
}
}
Expand Down
6 changes: 3 additions & 3 deletions examples/nextjs/pages/_document.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import React from 'react';
import Document, { Head, Main, NextScript } from 'next/document';
import Document, { Html, Head, Main, NextScript } from 'next/document';
import { ServerStyleSheets } from '@material-ui/core/styles';
import theme from '../src/theme';

export default class MyDocument extends Document {
render() {
return (
<html lang="en">
<Html lang="en">
<Head>
{/* PWA primary color */}
<meta name="theme-color" content={theme.palette.primary.main} />
Expand All @@ -19,7 +19,7 @@ export default class MyDocument extends Document {
<Main />
<NextScript />
</body>
</html>
</Html>
);
}
}
Expand Down

0 comments on commit cc3b03b

Please sign in to comment.