From 8c49c857e9cb5512c50ae1402405659958f0b85d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20Orb=C3=A1n?= Date: Wed, 28 Jun 2023 15:47:59 +0200 Subject: [PATCH 1/3] docs: clarify `reactStrictMode: true` by default Closes #51841 --- .../02-api-reference/05-next-config-js/reactStrictMode.mdx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/02-app/02-api-reference/05-next-config-js/reactStrictMode.mdx b/docs/02-app/02-api-reference/05-next-config-js/reactStrictMode.mdx index 35f42264611ea..069538e1d8021 100644 --- a/docs/02-app/02-api-reference/05-next-config-js/reactStrictMode.mdx +++ b/docs/02-app/02-api-reference/05-next-config-js/reactStrictMode.mdx @@ -15,4 +15,6 @@ module.exports = { } ``` +> **Good to know**: Since Next.js 13.4, Strict Mode is `true` by default, so the above configuration is not necessary. You can still disable Strict Mode by setting `reactStrictMode: false`. + If you or your team are not ready to use Strict Mode in your entire application, that's OK! You can incrementally migrate on a page-by-page basis using ``. From 2610b38ead4d653311b93a78e0eca110c0fbb79a Mon Sep 17 00:00:00 2001 From: Lee Robinson Date: Wed, 28 Jun 2023 19:30:29 -0700 Subject: [PATCH 2/3] Update docs/02-app/02-api-reference/05-next-config-js/reactStrictMode.mdx Co-authored-by: JJ Kasper --- .../02-api-reference/05-next-config-js/reactStrictMode.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/02-app/02-api-reference/05-next-config-js/reactStrictMode.mdx b/docs/02-app/02-api-reference/05-next-config-js/reactStrictMode.mdx index 069538e1d8021..140a58809777c 100644 --- a/docs/02-app/02-api-reference/05-next-config-js/reactStrictMode.mdx +++ b/docs/02-app/02-api-reference/05-next-config-js/reactStrictMode.mdx @@ -15,6 +15,6 @@ module.exports = { } ``` -> **Good to know**: Since Next.js 13.4, Strict Mode is `true` by default, so the above configuration is not necessary. You can still disable Strict Mode by setting `reactStrictMode: false`. +> **Good to know**: Since Next.js 13.4, Strict Mode is `true` by default with `app` router, so the above configuration is only necessary for `pages`. You can still disable Strict Mode by setting `reactStrictMode: false`. If you or your team are not ready to use Strict Mode in your entire application, that's OK! You can incrementally migrate on a page-by-page basis using ``. From 25b120cc36256d3e438cdfd652eeb5dcd48a0820 Mon Sep 17 00:00:00 2001 From: Lee Robinson Date: Wed, 28 Jun 2023 19:31:29 -0700 Subject: [PATCH 3/3] Update reactStrictMode.mdx --- .../02-api-reference/05-next-config-js/reactStrictMode.mdx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/docs/02-app/02-api-reference/05-next-config-js/reactStrictMode.mdx b/docs/02-app/02-api-reference/05-next-config-js/reactStrictMode.mdx index 140a58809777c..e0225d4350cf0 100644 --- a/docs/02-app/02-api-reference/05-next-config-js/reactStrictMode.mdx +++ b/docs/02-app/02-api-reference/05-next-config-js/reactStrictMode.mdx @@ -3,7 +3,7 @@ title: reactStrictMode description: The complete Next.js runtime is now Strict Mode-compliant, learn how to opt-in --- -> **Suggested**: We strongly suggest you enable Strict Mode in your Next.js application to better prepare your application for the future of React. +> **Good to know**: Since Next.js 13.4, Strict Mode is `true` by default with `app` router, so the above configuration is only necessary for `pages`. You can still disable Strict Mode by setting `reactStrictMode: false`. React's [Strict Mode](https://react.dev/reference/react/StrictMode) is a development mode only feature for highlighting potential problems in an application. It helps to identify unsafe lifecycles, legacy API usage, and a number of other features. @@ -15,6 +15,4 @@ module.exports = { } ``` -> **Good to know**: Since Next.js 13.4, Strict Mode is `true` by default with `app` router, so the above configuration is only necessary for `pages`. You can still disable Strict Mode by setting `reactStrictMode: false`. - If you or your team are not ready to use Strict Mode in your entire application, that's OK! You can incrementally migrate on a page-by-page basis using ``.