From eea25fc5dcaff5acab60230a18fece4cdfa2be05 Mon Sep 17 00:00:00 2001 From: Luis Alvarez D Date: Mon, 20 Jul 2020 23:00:21 -0500 Subject: [PATCH] [Docs] Remove false caveat in custom document docs (#15355) The statement is not true, we provide mocks for `req` and `res`. --- docs/advanced-features/custom-document.md | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/advanced-features/custom-document.md b/docs/advanced-features/custom-document.md index 5ca04cbaaa0a8..a3e02877b2988 100644 --- a/docs/advanced-features/custom-document.md +++ b/docs/advanced-features/custom-document.md @@ -54,7 +54,6 @@ The `ctx` object is equivalent to the one received in [`getInitialProps`](/docs/ - `Document` is only rendered in the server, event handlers like `onClick` won't work - React components outside of `
` will not be initialized by the browser. Do _not_ add application logic here or custom CSS (like `styled-jsx`). If you need shared components in all your pages (like a menu or a toolbar), take a look at the [`App`](/docs/advanced-features/custom-app.md) component instead - `Document`'s `getInitialProps` function is not called during client-side transitions, nor when a page is [statically optimized](/docs/advanced-features/automatic-static-optimization.md) -- Make sure to check if `ctx.req` / `ctx.res` are defined in `getInitialProps`. Those variables will be `undefined` when a page is being statically exported by [Automatic Static Optimization](/docs/advanced-features/automatic-static-optimization.md) or by [`next export`](/docs/advanced-features/static-html-export.md) ## Customizing `renderPage`