mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-07-03 08:40:12 +00:00
Remove buildManifest from renderPage response for Next.js 8.
This commit is contained in:
7
types/next/document.d.ts
vendored
7
types/next/document.d.ts
vendored
@@ -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<string, any>;
|
||||
html?: string;
|
||||
head?: Array<React.ReactElement<any>>;
|
||||
head?: React.ReactNode;
|
||||
}
|
||||
|
||||
export interface PageProps {
|
||||
|
||||
2
types/next/index.d.ts
vendored
2
types/next/index.d.ts
vendored
@@ -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 <https://github.com/dru89>
|
||||
// Brice BERNARD <https://github.com/brikou>
|
||||
|
||||
@@ -48,7 +48,7 @@ class MyDoc extends Document<WithUrlProps> {
|
||||
// with app and component enhancers
|
||||
const enhanceApp: Enhancer<PageProps, {}> = App => props => <App />;
|
||||
const enhanceComponent: Enhancer<PageProps, {}> = Component => props => <Component />;
|
||||
const { html, head, buildManifest } = renderPage({
|
||||
const { html, head } = renderPage({
|
||||
enhanceApp,
|
||||
enhanceComponent
|
||||
});
|
||||
@@ -60,7 +60,7 @@ class MyDoc extends Document<WithUrlProps> {
|
||||
// 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<WithUrlProps> {
|
||||
|
||||
render() {
|
||||
const { pathname, query } = this.props.__NEXT_DATA__;
|
||||
const { head, styles } = this.props;
|
||||
|
||||
return (
|
||||
<html>
|
||||
<Head nonce="nonce" any="property" should="work" here>
|
||||
{head}
|
||||
<title>My page</title>
|
||||
{this.props.styles}
|
||||
{styles}
|
||||
</Head>
|
||||
<body>
|
||||
<Main />
|
||||
|
||||
Reference in New Issue
Block a user