Skip to content

Commit

Permalink
Refactor some docs
Browse files Browse the repository at this point in the history
Closes GH-2375.

Reviewed-by: Christian Murphy <christian.murphy.42@gmail.com>
Reviewed-by: Titus Wormer <tituswormer@gmail.com>
  • Loading branch information
remcohaszing authored Oct 19, 2023
1 parent 44ca1ff commit b1f1f81
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
5 changes: 4 additions & 1 deletion docs/docs/using-mdx.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,10 @@ function _createMdxContent(props) {
export default function MDXContent(props = {}) {
const {wrapper: MDXLayout} = props.components || {}
return MDXLayout
? _jsx(MDXLayout, Object.assign({}, props, {children: _jsx(_createMdxContent, props)}))
? _jsx(MDXLayout, {
...props,
children: _jsx(_createMdxContent, props)}
)
: _createMdxContent(props)
}
```
Expand Down
15 changes: 12 additions & 3 deletions packages/mdx/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,10 @@ function _createMdxContent(props) {
export default function MDXContent(props = {}) {
const {wrapper: MDXLayout} = props.components || {}
return MDXLayout
? _jsx(MDXLayout, Object.assign({}, props, {children: _jsx(_createMdxContent, props)}))
? _jsx(MDXLayout, {
...props,
children: _jsx(_createMdxContent, props)
})
: _createMdxContent(props)
}
```
Expand Down Expand Up @@ -558,7 +561,10 @@ compile(file, {providerImportSource: '@mdx-js/react'})
+ }

return MDXLayout
? _jsx(MDXLayout, Object.assign({}, props, {children: _jsx(_createMdxContent, {})}))
? _jsx(MDXLayout, {
...props,
children: _jsx(_createMdxContent, {})
})
: _createMdxContent()
```

Expand Down Expand Up @@ -602,7 +608,10 @@ compile(file, {jsx: true})
export default function MDXContent(props = {}) {
const {wrapper: MDXLayout} = props.components || {}
return MDXLayout
- ? _jsx(MDXLayout, Object.assign({}, props, {children: _jsx(_createMdxContent, props)}))
- ? _jsx(MDXLayout, {
- ...props,
- children: _jsx(_createMdxContent, props)
- })
+ ? <MDXLayout {...props}><_createMdxContent {...props} /></MDXLayout>
: _createMdxContent(props)
}
Expand Down

1 comment on commit b1f1f81

@vercel
Copy link

@vercel vercel bot commented on b1f1f81 Oct 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

mdx – ./

mdx-mdx.vercel.app
mdxjs.com
mdx-git-main-mdx.vercel.app
v2.mdxjs.com

Please sign in to comment.