1
0
Fork 0

fix(shared): Sidestep MDX 2.2 dev runtime issue. Closes #3301

This commit is contained in:
Joost De Cock 2022-12-24 23:01:16 +01:00
parent b8984a3bef
commit f19ba58565
2 changed files with 4 additions and 2 deletions

View file

@ -22,7 +22,8 @@ const MdxWrapper = ({ mdx, app, t, components = {} }) => {
useEffect(() => { useEffect(() => {
;(async () => { ;(async () => {
setMdxModule(await run(mdx, runtime)) // Workaround for issue introduced in MDX 2.2
setMdxModule(await run(mdx, { ...runtime, jsxDEV: runtime.jsx }))
})() })()
}, [mdx]) }, [mdx])

View file

@ -14,7 +14,8 @@ const TocWrapper = ({ toc, app }) => {
useEffect(() => { useEffect(() => {
;(async () => { ;(async () => {
setMdxModule(await run(toc, runtime)) // Workaround for issue introduced in MDX 2.2
setMdxModule(await run(toc, { ...runtime, jsxDEV: runtime.jsx }))
})() })()
}, [toc]) }, [toc])