forked from vercel/next.js
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added React Strict Mode documentation (vercel#13723)
Added new documentation for React Strict mode under the `next.config.js` doc level. Closes vercel#13713
- Loading branch information
1 parent
011a144
commit c3b379f
Showing
2 changed files
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
--- | ||
description: The complete Next.js runtime is now Strict Mode-compliant, learn how to opt-in | ||
--- | ||
|
||
# React Strict Mode | ||
|
||
> **Suggested**: We strongly suggest you enable Strict Mode in your Next.js application to better prepare your application for the future of React. | ||
The Next.js runtime is now Strict Mode-compliant. To opt-in to Strict Mode, configure the following option in your `next.config.js`: | ||
|
||
```js | ||
// next.config.js | ||
module.exports = { | ||
reactStrictMode: true, | ||
} | ||
``` | ||
|
||
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 `<React.StrictMode>`](https://reactjs.org/docs/strict-mode.html). | ||
|
||
React's Strict Mode 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. | ||
|
||
## Related | ||
|
||
<div class="card"> | ||
<a href="/docs/api-reference/next.config.js/introduction.md"> | ||
<b>Introduction to next.config.js:</b> | ||
<small>Learn more about the configuration file used by Next.js.</small> | ||
</a> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters