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:

  1. // next.config.js
  2. module.exports = {
  3. reactStrictMode: true,
  4. }

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>.

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

[

Introduction to next.config.js

Learn more about the configuration file used by Next.js.]($0b4bd5a3a6817758.md)