_document refactoring + ts
This commit is contained in:
1 parent
effaf07ecb
commit
5071b0292d
1 file changed
+4
-12
@@ -1,20 +1,12 @@
|
|||||||
import React from 'react'
|
|
||||||
import Document, { Html, Head, Main, NextScript } from 'next/document'
|
import Document, { Html, Head, Main, NextScript } from 'next/document'
|
||||||
import { YMetrika } from '../src/components/YMetrika'
|
import { YMetrika } from 'src/components/YMetrika'
|
||||||
import { GAnalytics } from '../src/components/GAnalytics'
|
import { GAnalytics } from 'src/components/GAnalytics'
|
||||||
|
|
||||||
export default class MyDocument extends Document {
|
export default class MyDocument extends Document {
|
||||||
// static async getInitialProps(ctx) {
|
|
||||||
// const initialProps = await Document.getInitialProps(ctx);
|
|
||||||
// return { ...initialProps };
|
|
||||||
// }
|
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
return (
|
return (
|
||||||
<Html>
|
<Html>
|
||||||
<Head>
|
<Head>
|
||||||
<style>{`body { margin: 0 } /* custom! */`}</style>
|
|
||||||
|
|
||||||
<meta charSet="utf-8" />
|
<meta charSet="utf-8" />
|
||||||
<meta name="viewport" content="width=device-width, maximum-scale=1.0" />
|
<meta name="viewport" content="width=device-width, maximum-scale=1.0" />
|
||||||
<meta name="referrer" content="unsafe-url" />
|
<meta name="referrer" content="unsafe-url" />
|
||||||
@@ -62,11 +54,11 @@ export default class MyDocument extends Document {
|
|||||||
<GAnalytics account={'UA-60209057-1'} />
|
<GAnalytics account={'UA-60209057-1'} />
|
||||||
</Head>
|
</Head>
|
||||||
|
|
||||||
<body className="custom_class">
|
<body>
|
||||||
<Main />
|
<Main />
|
||||||
<NextScript />
|
<NextScript />
|
||||||
</body>
|
</body>
|
||||||
</Html>
|
</Html>
|
||||||
);
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user