Skip to content

Commit

Permalink
Added React Strict Mode documentation (vercel#13723)
Browse files Browse the repository at this point in the history
Added new documentation for React Strict mode under the `next.config.js` doc level.

Closes vercel#13713
  • Loading branch information
jamesmosier authored and rokinsky committed Jul 11, 2020
1 parent 011a144 commit c3b379f
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
29 changes: 29 additions & 0 deletions docs/api-reference/next.config.js/react-strict-mode.md
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>
4 changes: 4 additions & 0 deletions docs/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,10 @@
{
"title": "exportPathMap",
"path": "/docs/api-reference/next.config.js/exportPathMap.md"
},
{
"title": "React Strict Mode",
"path": "/docs/api-reference/next.config.js/react-strict-mode.md"
}
]
}
Expand Down

0 comments on commit c3b379f

Please sign in to comment.