@@ -92,20 +92,21 @@ Yields roughly:
92
92
/* @jsxRuntime automatic @jsxImportSource react */
93
93
import {Fragment as _Fragment , jsx as _jsx , jsxs as _jsxs } from ' react/jsx-runtime'
94
94
95
- export const Thing = () => _jsx (_Fragment, {children: ' World! ' })
95
+ export const Thing = () => _jsx (_Fragment, {children: ' World' })
96
96
97
- function MDXContent (props = {}) {
98
- const {wrapper: MDXLayout } = props .components || ({})
99
- return MDXLayout
100
- ? _jsx (MDXLayout, Object .assign ({}, props, {children: _jsx (_createMdxContent, {})}))
101
- : _createMdxContent ()
102
- function _createMdxContent () {
103
- const _components = Object .assign ({h1: ' h1' }, props .components )
104
- return _jsxs (_components .h1 , {children: [' Hello, ' , _jsx (Thing, {})]})
105
- }
97
+ function _createMdxContent (props ) {
98
+ const _components = Object .assign ({h1: ' h1' }, props .components )
99
+ return _jsxs (_components .h1 , {
100
+ children: [' Hello ' , _jsx (Thing, {})]
101
+ })
106
102
}
107
103
108
- export default MDXContent
104
+ export default function MDXContent (props = {}) {
105
+ const {wrapper: MDXLayout } = props .components || {}
106
+ return MDXLayout
107
+ ? _jsx (MDXLayout, Object .assign ({}, props, {children: _jsx (_createMdxContent, props)}))
108
+ : _createMdxContent (props)
109
+ }
109
110
```
110
111
111
112
See [ § Using MDX] [ using-mdx ] for more on how MDX work and how to use the result.
@@ -295,15 +296,17 @@ async function main(code) {
295
296
…yields:
296
297
297
298
``` js
298
- import {Fragment as _Fragment , jsx as _jsx } from ' react/jsx-runtime'
299
+ /* @jsxRuntime automatic @jsxImportSource react */
300
+ import {jsx as _jsx , jsxs as _jsxs } from ' react/jsx-runtime'
299
301
export const no = 3.14
300
- function MDXContent (props = {} ) { /* … */ }
301
- export default MDXContent
302
+ function _createMdxContent (props ) { /* … */ }
303
+ export default function MDXContent ( props = {}) { /* … */ }
302
304
```
303
305
304
306
``` js
305
307
const {Fragment: _Fragment , jsx: _jsx } = arguments [0 ]
306
308
const no = 3.14
309
+ function _createMdxContent (props ) { /* … */ }
307
310
function MDXContent (props = {}) { /* … */ }
308
311
return {no, default: MDXContent}
309
312
```
@@ -352,6 +355,7 @@ console.log(String(compileSync(code, {outputFormat: 'function-body', useDynamicI
352
355
const {Fragment: _Fragment , jsx: _jsx , jsxs: _jsxs } = arguments [0 ]
353
356
const {name } = await import (' ./meta.js' )
354
357
const {no } = await import (' ./numbers.js' )
358
+ function _createMdxContent (props ) { /* … */ }
355
359
function MDXContent (props = {}) { /* … */ }
356
360
return {no, default: MDXContent}
357
361
```
@@ -393,6 +397,7 @@ async function main() {
393
397
``` js
394
398
import {Fragment as _Fragment , jsx as _jsx } from ' react/jsx-runtime'
395
399
export {number } from ' https://a.full/data.js'
400
+ function _createMdxContent (props ) { /* … */ }
396
401
function MDXContent (props = {}) { /* … */ }
397
402
export default MDXContent
398
403
```
@@ -537,20 +542,19 @@ compile(file, {providerImportSource: '@mdx-js/react'})
537
542
538
543
export const Thing = () => _jsx(_Fragment, {children: 'World!'})
539
544
540
- function MDXContent(props = {}) {
541
- - const {wrapper: MDXLayout} = props.components || ({})
545
+ function _createMdxContent(props) {
546
+ - const _components = Object.assign({h1: 'h1'}, props.components)
547
+ + const _components = Object.assign({h1: 'h1'}, _provideComponents(), props.components)
548
+ return _jsxs(_components.h1, {children: ['Hello ', _jsx(Thing, {})]})
549
+ }
550
+
551
+ export default function MDXContent(props = {}) {
552
+ - const {wrapper: MDXLayout} = props.components || {}
542
553
+ const {wrapper: MDXLayout} = Object.assign({}, _provideComponents(), props.components)
554
+
543
555
return MDXLayout
544
556
? _jsx(MDXLayout, Object.assign({}, props, {children: _jsx(_createMdxContent, {})}))
545
557
: _createMdxContent()
546
- function _createMdxContent() {
547
- - const _components = Object.assign({h1: 'h1'}, props.components)
548
- + const _components = Object.assign({h1: 'h1'}, _provideComponents(), props.components)
549
- return _jsxs(_components.h1, {children: ['Hello, ', _jsx(Thing, {})]})
550
- }
551
- }
552
-
553
- export default MDXContent
554
558
```
555
559
556
560
</details >
@@ -579,20 +583,20 @@ compile(file, {jsx: true})
579
583
- export const Thing = () => _jsx(_Fragment, {children: 'World!'})
580
584
+ export const Thing = () => <>World!</>
581
585
582
- function MDXContent(props = {}) {
583
- const {wrapper: MDXLayout} = props.components || ({})
584
- return MDXLayout
585
- - ? _jsx(MDXLayout, Object.assign({}, props, {children: _jsx(_createMdxContent, {})}))
586
- + ? <MDXLayout {...props}><_createMdxContent /></MDXLayout>
587
- : _createMdxContent()
588
- function _createMdxContent() {
589
- const _components = Object.assign({h1: 'h1'}, props.components)
590
- - return _jsxs(_components.h1, {children: ['Hello, ', _jsx(Thing, {})]})
591
- + return <_components.h1>{"Hello, "}<Thing /></_components.h1>
592
- }
586
+ function _createMdxContent(props) {
587
+ const _components = Object.assign({h1: 'h1'}, props.components)
588
+ - return _jsxs(_components.h1, {children: ['Hello ', _jsx(Thing, {})]})
589
+ + return <_components.h1>{"Hello "}<Thing /></_components.h1>
593
590
}
594
591
595
- export default MDXContent
592
+ export default function MDXContent(props = {}) {
593
+ const {wrapper: MDXLayout} = props.components || {}
594
+ return MDXLayout
595
+ - ? _jsx(MDXLayout, Object.assign({}, props, {children: _jsx(_createMdxContent, props)}))
596
+ + ? <MDXLayout {...props}><_createMdxContent {...props} /></MDXLayout>
597
+ : _createMdxContent(props)
598
+ }
599
+ }
596
600
```
597
601
598
602
</details >
0 commit comments