MDX does not compile inside the body of an arrow function. Stick to HTML
syntax when you can or use a default export if you need to use MDX inside of your component.
Import the snippet into your destination file and pass in the props
destination-file.mdx
Copy
Ask AI
---title: My titledescription: My Description---import { MyComponent } from '/snippets/custom-component.mdx';Lorem ipsum dolor sit amet.<MyComponent title={'Custom title'} />
By default, Mintlify employs server-side rendering, generating content
at build time. For client-side content loading, ensure to verify the
document object’s availability before initiating the rendering process.
snippets/client-component.mdx
Copy
Ask AI
{/* `setTimeout` simulates a React.useEffect, which is called after the component is mounted. */}export const ClientComponent = () => { if (typeof document === "undefined") { return null; } else { setTimeout(() => { const clientComponent = document.getElementById("client-component"); if (clientComponent) { clientComponent.innerHTML = "Hello, client-side component!"; } }, 1); return <div id="client-component"></div> }}