fix(theme): make warning a first-class admonition, and deprecate caution admonition (#9308)

This commit is contained in:
Sébastien Lorber 2023-09-15 10:48:21 +02:00 committed by GitHub
parent 58be496da2
commit f5ae537d3e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
339 changed files with 666 additions and 515 deletions

View file

@ -57,7 +57,7 @@ This component doesn't catch build-time errors and only protects against client-
- `fallback`: an optional render callback returning a JSX element. It will receive an object with 2 attributes: `error`, the error that was caught, and `tryAgain`, a function (`() => void`) callback to reset the error in the component and try rendering it again. If not present, `@theme/Error` will be rendered instead. `@theme/Error` is used for the error boundaries wrapping the site, above the layout.
:::caution
:::warning
The `fallback` prop is a callback, and **not a React functional component**. You can't use React hooks inside this callback.
@ -411,7 +411,7 @@ The `siteConfig` object only contains **serializable values** (values that are p
Returns `true` when the React app has successfully hydrated in the browser.
:::caution
:::warning
Use this hook instead of `typeof windows !== 'undefined'` in React rendering logic.
@ -437,7 +437,7 @@ const MyComponent = () => {
React hook to prepend your site `baseUrl` to a string.
:::caution
:::warning
**Don't use it for regular links!**
@ -697,7 +697,7 @@ export default function Home() {
A module that exposes a few boolean variables to check the current rendering environment.
:::caution
:::warning
For React rendering logic, use [`useIsBrowser()`](#useIsBrowser) or [`<BrowserOnly>`](#browseronly) instead.