diff --git a/types/next/document.d.ts b/types/next/document.d.ts index d0e6d2c91b..3933d8c117 100644 --- a/types/next/document.d.ts +++ b/types/next/document.d.ts @@ -2,10 +2,13 @@ import * as React from "react"; import { NextContext, NextComponentType } from "."; import { DefaultQuery } from "./router"; +/** + * Result from renderPage(). + * https://github.com/zeit/next.js/blob/v8.0.0/packages/next/pages/_document.js#L18 + */ export interface RenderPageResponse { - buildManifest: Record; html?: string; - head?: Array>; + head?: React.ReactNode; } export interface PageProps { diff --git a/types/next/index.d.ts b/types/next/index.d.ts index 8d911ab2c1..73d3d70800 100644 --- a/types/next/index.d.ts +++ b/types/next/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for next 7.0 +// Type definitions for next 8.0 // Project: https://github.com/zeit/next.js/packages/next // Definitions by: Drew Hays // Brice BERNARD diff --git a/types/next/test/next-document-tests.tsx b/types/next/test/next-document-tests.tsx index 1cd217a749..d5be842c4c 100644 --- a/types/next/test/next-document-tests.tsx +++ b/types/next/test/next-document-tests.tsx @@ -48,7 +48,7 @@ class MyDoc extends Document { // with app and component enhancers const enhanceApp: Enhancer = App => props => ; const enhanceComponent: Enhancer = Component => props => ; - const { html, head, buildManifest } = renderPage({ + const { html, head } = renderPage({ enhanceApp, enhanceComponent }); @@ -60,7 +60,7 @@ class MyDoc extends Document { // Custom prop const url = req!.url; - return { html, head, buildManifest, styles, url }; + return { html, head, styles, url }; } constructor(props: WithUrlProps & DocumentProps) { @@ -73,12 +73,14 @@ class MyDoc extends Document { render() { const { pathname, query } = this.props.__NEXT_DATA__; + const { head, styles } = this.props; return ( + {head} My page - {this.props.styles} + {styles}