mirror of
https://github.com/hazemKrimi/personal-website.git
synced 2026-05-02 02:10:27 +00:00
Remove typescript type warnings
This commit is contained in:
+2
-2
@@ -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);
|
||||||
|
|||||||
Reference in New Issue
Block a user