{/* The content of this doc is shared between the app and pages router. You can use the `<PagesOnly>Content</PagesOnly>` component to add content that is specific to the Pages Router. Any shared content should not be wrapped in a component. */}
> **值得注意**: 自 Next.js 13.5.1 起,`app` 路由器的严格模式(Strict Mode)默认启用为 `true`,因此上述配置仅对 `pages` 路由器有必要。您仍然可以通过设置 `reactStrictMode: false` 来禁用严格模式。
> **建议**: 我们强烈建议您在 Next.js 应用程序中启用严格模式(Strict Mode),以便更好地为您的应用程序迎接 React 的未来做好准备。
React 的[严格模式(Strict Mode)](https://react.dev/reference/react/StrictMode)是一个仅限开发模式的功能,用于突出应用程序中可能存在的问题。它有助于识别不安全的生命周期、遗留 API 用法以及许多其他功能。
Next.js 运行时与严格模式(Strict Mode)兼容。要选择启用严格模式,请在您的 `next.config.js` 中配置以下选项:
```js filename="next.config.js"
module.exports = {
reactStrictMode: true,
}如果您或您的团队尚未准备好在整个应用程序中使用严格模式(Strict Mode),那也没关系!您可以使用 <React.StrictMode> 逐页增量迁移。