@@ -342,7 +342,7 @@ import * as runtime from 'react/jsx-runtime'
342
342
343
343
const code = ' ' // To do: get `code` from server somehow.
344
344
345
- const {default : Content} = await run (code , runtime )
345
+ const {default : Content} = await run (code , { ... runtime , baseUrl: import . meta . url } )
346
346
347
347
console .log (Content )
348
348
```
@@ -569,7 +569,7 @@ Configuration for `createProcessor` (TypeScript type).
569
569
570
570
const path = ' example.mdx'
571
571
const value = await fs .readFile (path )
572
- const MDXContent = (await evaluate ({path , value }, runtime )).default
572
+ const MDXContent = (await evaluate ({path , value }, { ... runtime , baseUrl: import . meta . url } )).default
573
573
574
574
console .log (MDXContent ({}))
575
575
```
@@ -595,8 +595,8 @@ Configuration for `createProcessor` (TypeScript type).
595
595
596
596
const path = 'example.mdx'
597
597
const value = await fs.readFile(path)
598
- -const MDXContent = (await evaluate({path, value}, runtime)).default
599
- +const MDXContent = (await evaluate({path, value}, {development: true, ...runtime})).default
598
+ -const MDXContent = (await evaluate({path, value}, {... runtime, baseUrl: import.meta.url} )).default
599
+ +const MDXContent = (await evaluate({path, value}, {development: true, ...runtime, baseUrl: import.meta.url })).default
600
600
601
601
console.log(MDXContent({}))
602
602
```
@@ -1021,7 +1021,7 @@ matter).
1021
1021
* ` jsxs ` ([ ` Jsx ` ] [ api-jsx ] , optional)
1022
1022
β function to generate an element with dynamic children in production mode
1023
1023
* ` useMDXComponents ` ([ ` UseMdxComponents ` ] [ api-use-mdx-components ] , optional)
1024
- β function to get components from context
1024
+ β function to get components to use
1025
1025
1026
1026
###### Examples
1027
1027
@@ -1030,7 +1030,7 @@ A `/jsx-runtime` module will expose `Fragment`, `jsx`, and `jsxs`:
1030
1030
``` tsx
1031
1031
import * as runtime from ' react/jsx-runtime'
1032
1032
1033
- const {default : Content} = await evaluate (' # hi' , {... runtime , ... otherOptions })
1033
+ const {default : Content} = await evaluate (' # hi' , {... runtime , baseUrl: import . meta . url , ... otherOptions })
1034
1034
1035
1035
```
1036
1036
@@ -1039,7 +1039,7 @@ A `/jsx-dev-runtime` module will expose `Fragment` and `jsxDEV`:
1039
1039
``` tsx
1040
1040
import * as runtime from ' react/jsx-dev-runtime'
1041
1041
1042
- const {default : Content} = await evaluate (' # hi' , {development: true , ... runtime , ... otherOptions })
1042
+ const {default : Content} = await evaluate (' # hi' , {development: true , baseUrl: import . meta . url , ... runtime , ... otherOptions })
1043
1043
```
1044
1044
1045
1045
Our providers will expose ` useMDXComponents ` :
@@ -1048,12 +1048,12 @@ Our providers will expose `useMDXComponents`:
1048
1048
import * as provider from ' @mdx-js/react'
1049
1049
import * as runtime from ' react/jsx-runtime'
1050
1050
1051
- const {default : Content} = await evaluate (' # hi' , {... provider , ... runtime , ... otherOptions })
1051
+ const {default : Content} = await evaluate (' # hi' , {... provider , ... runtime , baseUrl: import . meta . url , ... otherOptions })
1052
1052
```
1053
1053
1054
1054
### ` UseMdxComponents `
1055
1055
1056
- Get components from context (TypeScript type).
1056
+ Get components (TypeScript type).
1057
1057
1058
1058
###### Parameters
1059
1059
0 commit comments