From 7a1c636cf8e1a1c4340c465f72dcbc27cc697e88 Mon Sep 17 00:00:00 2001 From: callumok2004 Date: Mon, 21 Jun 2021 04:01:23 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=8C=9F=20Code=20Cleanup?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/{_document.tsx => _document.js} | 6 +++--- tsconfig.json | 19 +++++++++++++++---- 2 files changed, 18 insertions(+), 7 deletions(-) rename pages/{_document.tsx => _document.js} (77%) diff --git a/pages/_document.tsx b/pages/_document.js similarity index 77% rename from pages/_document.tsx rename to pages/_document.js index 4a48cfe..d01166c 100644 --- a/pages/_document.tsx +++ b/pages/_document.js @@ -9,11 +9,11 @@ export default class MyDocument extends Document { try { ctx.renderPage = () => originalRenderPage({ - enhanceApp: (App: any) => (props: any) => - sheet.collectStyles(), + enhanceApp: App => props => sheet.collectStyles() }) - const initialProps = await Document.getInitialProps(ctx) + const initialProps = await Document.getInitialProps(ctx); + return { ...initialProps, styles: ( diff --git a/tsconfig.json b/tsconfig.json index 4fa631c..fd21301 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,7 +1,11 @@ { "compilerOptions": { "target": "es5", - "lib": ["dom", "dom.iterable", "esnext"], + "lib": [ + "dom", + "dom.iterable", + "esnext" + ], "allowJs": true, "skipLibCheck": true, "strict": true, @@ -14,6 +18,13 @@ "isolatedModules": true, "jsx": "preserve" }, - "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"], - "exclude": ["node_modules"] -} + "include": [ + "next-env.d.ts", + "**/*.ts", + "**/*.tsx", + "pages/_document.js" + ], + "exclude": [ + "node_modules" + ] +} \ No newline at end of file