mirror of
https://github.com/facebook/docusaurus.git
synced 2025-08-04 01:09:20 +02:00
fix(theme): make warning a first-class admonition, and deprecate caution admonition (#9308)
This commit is contained in:
parent
58be496da2
commit
f5ae537d3e
339 changed files with 666 additions and 515 deletions
|
@ -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.
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue