File tree 1 file changed +14
-0
lines changed
1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -52,6 +52,20 @@ You will get a runtime error if these features are used in MDX without
52
52
If you passed the ` useDynamicImport ` option before, remove it, the behavior
53
53
is now the default.
54
54
55
+ If you use ` react/jsx-runtime ` , you might get a TypeScript error (such as
56
+ ` Property 'Fragment' is missing in type ` ), because it is typed incorrectly.
57
+ To remediate this, do:
58
+
59
+ ``` tsx
60
+ import {type Fragment , type Jsx , run } from ' @mdx-js/mdx'
61
+ import * as runtime_ from ' react/jsx-runtime'
62
+
63
+ // @ts-expect-error: the automatic react runtime is untyped.
64
+ const runtime: {Fragment: Fragment ; jsx: Jsx ; jsxs: Jsx } = runtime_
65
+
66
+ const result = await run (' # hi' , {... runtime , baseUrl: import .meta .url })
67
+ ```
68
+
55
69
## Use the automatic JSX runtime
56
70
57
71
If you use the classic runtime, switch to the automatic runtime.
You can’t perform that action at this time.
1 commit comments
vercel[bot] commentedon Oct 25, 2023
Successfully deployed to the following URLs:
mdx – ./
mdxjs.com
mdx-git-main-mdx.vercel.app
mdx-mdx.vercel.app
v2.mdxjs.com