Skip to content

Commit

Permalink
adjust the docs
Browse files Browse the repository at this point in the history
  • Loading branch information
siriwatknp committed Nov 25, 2024
1 parent 1d15d41 commit 837c1a4
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions docs/data/material/customization/dark-mode/dark-mode.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,15 +132,17 @@ To instantly switch between color schemes with no transition, apply the `disable
</ThemeProvider>
```

## 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
<ThemeProvider theme={theme} disableRerender>
<ThemeProvider theme={theme} noSsr>
```

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.

Check warning on line 147 in docs/data/material/customization/dark-mode/dark-mode.md

View workflow job for this annotation

GitHub Actions / runner / vale

[vale] reported by reviewdog 🐶 [Google.Will] Avoid using 'will'. Raw Output: {"message": "[Google.Will] Avoid using 'will'.", "location": {"path": "docs/data/material/customization/dark-mode/dark-mode.md", "range": {"start": {"line": 147, "column": 81}}}, "severity": "WARNING"}
- 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.
Expand Down

0 comments on commit 837c1a4

Please sign in to comment.