Skip to main content

MDX

input.mdx
export const Thing = () => <>World</>;

# Hello <Thing />
output-outline.jsx
/* @jsxRuntime automatic @jsxImportSource react */

export const Thing = () => <>World</>;

export default function MDXContent() {
return (
<h1>
Hello <Thing />
</h1>
);
}
  • 默认 export MDXContent
    • props
      • components: Record<string,ComponentType> | ()=>Record<string,ComponentType>
  • export default function Layout - 同 components.wrapper
  • <MDXProvider components={components}></MDXProvider>
    • 上下文配置好组件

MDX v2