Remove typescript type warnings

This commit is contained in:
Hazem Krimi
2021-01-05 22:45:36 +01:00
parent 9c13d4765f
commit 6f65f5c298
+2 -2
View File
@@ -2,14 +2,14 @@ import Document from 'next/document';
import { ServerStyleSheet } from 'styled-components'; import { ServerStyleSheet } from 'styled-components';
class Doc extends Document { class Doc extends Document {
static async getInitialProps(ctx) { static async getInitialProps(ctx: any) {
const sheet = new ServerStyleSheet(); const sheet = new ServerStyleSheet();
const originalRenderPage = ctx.renderPage; const originalRenderPage = ctx.renderPage;
try { try {
ctx.renderPage = () => ctx.renderPage = () =>
originalRenderPage({ originalRenderPage({
enhanceApp: App => props => sheet.collectStyles(<App {...props} />) enhanceApp: (App: any) => (props: any) => sheet.collectStyles(<App {...props} />)
}); });
const initialProps = await Document.getInitialProps(ctx); const initialProps = await Document.getInitialProps(ctx);