docs: wrap more JSX in mdx-code-block (#7568)

This commit is contained in:
Joshua Chen 2022-06-05 15:41:06 +08:00 committed by GitHub
parent 6d481f6a29
commit c03def7d5f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 58 additions and 1 deletions

View file

@ -23,7 +23,9 @@ function HelloCodeTitle(props) {
```
````
```mdx-code-block
<BrowserWindow>
```
```jsx title="/src/components/HelloCodeTitle.js"
function HelloCodeTitle(props) {
@ -31,7 +33,9 @@ function HelloCodeTitle(props) {
}
```
```mdx-code-block
</BrowserWindow>
```
## Syntax highlighting {#syntax-highlighting}
@ -809,6 +813,7 @@ export default function MyReactPage() {
}
```
```mdx-code-block
<BrowserWindow>
<CodeBlock
language="jsx"
@ -819,6 +824,7 @@ export default function MyReactPage() {
}`}
</CodeBlock>
</BrowserWindow>
```
The props accepted are `language`, `title` and `showLineNumbers`, in the same way as you write Markdown code blocks.