Understanding MDX

OneAsWell
5 分钟阅读

MDX allows you to use JSX in your Markdown content.

What is MDX?

MDX is a format that lets you seamlessly write JSX in your Markdown documents.

Why use MDX?

  • Write Markdown with embedded React components
  • Import and use custom components in your content
  • Full access to JavaScript expressions within Markdown

Example

You can import and use components:

import { Chart } from './components/Chart'

<Chart data={someData} />

This makes it perfect for technical blogs and documentation sites!

Learn More

Check out the MDX documentation for more information.