File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
Expand file tree Collapse file tree 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
5252If you passed the ` useDynamicImport ` option before, remove it, the behavior
5353is now the default.
5454
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+
5569## Use the automatic JSX runtime
5670
5771If you use the classic runtime, switch to the automatic runtime.
You can’t perform that action at this time.
0 commit comments