mirror of
https://github.com/facebook/docusaurus.git
synced 2025-04-28 17:57:48 +02:00
refactor(website): change date of v3 preparation blog post + add missing section (#9358)
This commit is contained in:
parent
8ae5264fd4
commit
0624007271
4 changed files with 32 additions and 0 deletions
Before Width: | Height: | Size: 260 KiB After Width: | Height: | Size: 260 KiB |
Before Width: | Height: | Size: 209 KiB After Width: | Height: | Size: 209 KiB |
Before Width: | Height: | Size: 218 KiB After Width: | Height: | Size: 218 KiB |
|
@ -212,6 +212,38 @@ http://localhost:3000
|
|||
|
||||
:::
|
||||
|
||||
#### Lower-case MDXComponent mapping
|
||||
|
||||
For users providing a [custom `MDXComponent`mapping](/docs/3.0.0-beta.0/markdown-features/react#mdx-component-scope), components are now "sandboxed":
|
||||
|
||||
- a `MDXComponent` mapping for `h1` only gets used for `# hi` but not for `<h1>hi</h1>`
|
||||
- a **lower-cased** custom element name will not be substituted by its respective `MDXComponent` component anymore
|
||||
|
||||
:::danger visual difference
|
||||
|
||||
Your [`MDXComponent` component mapping](/docs/3.0.0-beta.0/markdown-features/react#mdx-component-scope) might not be applied as before, and your custom components might no longer be used.
|
||||
|
||||
:::
|
||||
|
||||
:::tip How to prepare
|
||||
|
||||
For native Markdown elements, you can keep using **lower-case**: `p`, `h1`, `img`, `a`...
|
||||
|
||||
For any other element, **use upper-case names**.
|
||||
|
||||
```diff title="src/theme/MDXComponents.js"
|
||||
import MDXComponents from '@theme-original/MDXComponents';
|
||||
|
||||
export default {
|
||||
...MDXComponents,
|
||||
p: (props) => <p {...props} className="my-paragraph"/>
|
||||
- myElement: (props) => <div {...props} className="my-class" />,
|
||||
+ MyElement: (props) => <div {...props} className="my-class" />,
|
||||
};
|
||||
```
|
||||
|
||||
:::
|
||||
|
||||
#### Unintended extra paragraphs
|
||||
|
||||
In MDX v2, it is now possible to interleave JSX and Markdown more easily without requiring extra line breaks. Writing content on multiple lines can also produce new expected `<p>` tags.
|
Loading…
Add table
Reference in a new issue