From e29866a3525ccdd2ad99ad06d85f889d5f63b515 Mon Sep 17 00:00:00 2001 From: GatsbyJS Bot Date: Mon, 7 Dec 2020 09:46:43 -0500 Subject: [PATCH] fix(gatsby): Add bodyComponent to replaceRenderer args (#28456) (#28486) Co-authored-by: gatsbybot (cherry picked from commit 9a77810b1f2f0a529dd13760d0a7b73b2b50fd81) Co-authored-by: Matt Kane --- packages/gatsby/cache-dir/api-ssr-docs.js | 1 + packages/gatsby/index.d.ts | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/gatsby/cache-dir/api-ssr-docs.js b/packages/gatsby/cache-dir/api-ssr-docs.js index 0a34f4078fc96..2fead5cdf1a58 100644 --- a/packages/gatsby/cache-dir/api-ssr-docs.js +++ b/packages/gatsby/cache-dir/api-ssr-docs.js @@ -9,6 +9,7 @@ * rendering. * @param {object} $0 * @param {string} $0.pathname The pathname of the page currently being rendered. + * @param {ReactNode} $0.bodyComponent The React element to be rendered as the page body * @param {function} $0.replaceBodyHTMLString Call this with the HTML string * you render. **WARNING** if multiple plugins implement this API it's the * last plugin that "wins". TODO implement an automated warning against this. diff --git a/packages/gatsby/index.d.ts b/packages/gatsby/index.d.ts index b9d6e93865f15..1581819c95ae7 100644 --- a/packages/gatsby/index.d.ts +++ b/packages/gatsby/index.d.ts @@ -921,6 +921,7 @@ export interface RenderBodyArgs extends NodePluginArgs { export interface ReplaceRendererArgs extends NodePluginArgs { replaceBodyHTMLString: (str: string) => void + bodyComponent: React.ReactNode setHeadComponents: (comp: React.ReactNode[]) => void setHtmlAttributes: (attr: ReactProps) => void setBodyAttributes: (attr: ReactProps) => void @@ -1285,7 +1286,7 @@ export interface Actions { traceId?: string ): void - printTypeDefinitions ( + printTypeDefinitions( path?: string, include?: { types?: Array; plugins?: Array }, exclude?: { types?: Array; plugins?: Array },