Skip to content
Mayank edited this page Jun 22, 2025 · 1 revision

⚡ Quick Usage

import { Md } from "@m2d/react-markdown/client";
import { useRef } from "react";
import { toDocx } from "mdast2docx";

const astRef = useRef([]);

<Md astRef={astRef}>
  {`# Hello\n\nThis is **Markdown**.`}
</Md>

<button onClick={() => {
  const doc = toDocx(astRef.current[0].mdast);
  // Save or export
}}>Export</button>

Clone this wiki locally