From 837c1a487d213740d32fbd554863e769c2e20e46 Mon Sep 17 00:00:00 2001 From: siriwatknp Date: Mon, 25 Nov 2024 11:24:02 +0700 Subject: [PATCH] adjust the docs --- .../data/material/customization/dark-mode/dark-mode.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/docs/data/material/customization/dark-mode/dark-mode.md b/docs/data/material/customization/dark-mode/dark-mode.md index 86fddad5ae626e..77c76d8d820b07 100644 --- a/docs/data/material/customization/dark-mode/dark-mode.md +++ b/docs/data/material/customization/dark-mode/dark-mode.md @@ -132,15 +132,17 @@ To instantly switch between color schemes with no transition, apply the `disable ``` -## Disable rerender +## Disable double rendering -By default, the `ThemeProvider` rerenders when the theme contains light **and** dark color schemes to prevent SSR hydration mismatches. To disable this behavior, apply the `disableRerender` prop as `true` to the `ThemeProvider` component: +By default, the `ThemeProvider` rerenders when the theme contains light **and** dark color schemes to prevent SSR hydration mismatches. + +To disable this behavior, use the `noSsr` prop: ```jsx - + ``` -This prop is useful if you are building: +`noSsr` is useful if you are building: - A client-only application, such as a single-page application (SPA). This prop will optimize the performance and prevent the dark mode flickering when users refresh the page. - A server-rendered application with [Suspense](https://react.dev/reference/react/Suspense). However, you must ensure that the server render output matches the initial render output on the client.