Skip to content

Commit 0624007

Browse files
authored
refactor(website): change date of v3 preparation blog post + add missing section (#9358)
1 parent 8ae5264 commit 0624007

File tree

4 files changed

+32
-0
lines changed

4 files changed

+32
-0
lines changed

website/blog/2023-09-25-preparing-your-site-for-docusaurus-v3/index.mdx renamed to website/blog/2023-09-29-preparing-your-site-for-docusaurus-v3/index.mdx

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,38 @@ http://localhost:3000
212212

213213
:::
214214

215+
#### Lower-case MDXComponent mapping
216+
217+
For users providing a [custom `MDXComponent`mapping](/docs/3.0.0-beta.0/markdown-features/react#mdx-component-scope), components are now "sandboxed":
218+
219+
- a `MDXComponent` mapping for `h1` only gets used for `# hi` but not for `<h1>hi</h1>`
220+
- a **lower-cased** custom element name will not be substituted by its respective `MDXComponent` component anymore
221+
222+
:::danger visual difference
223+
224+
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.
225+
226+
:::
227+
228+
:::tip How to prepare
229+
230+
For native Markdown elements, you can keep using **lower-case**: `p`, `h1`, `img`, `a`...
231+
232+
For any other element, **use upper-case names**.
233+
234+
```diff title="src/theme/MDXComponents.js"
235+
import MDXComponents from '@theme-original/MDXComponents';
236+
237+
export default {
238+
...MDXComponents,
239+
p: (props) => <p {...props} className="my-paragraph"/>
240+
- myElement: (props) => <div {...props} className="my-class" />,
241+
+ MyElement: (props) => <div {...props} className="my-class" />,
242+
};
243+
```
244+
245+
:::
246+
215247
#### Unintended extra paragraphs
216248

217249
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.

0 commit comments

Comments
 (0)