Parse and render MDX in a runtime environment.
⚠️ warning: this is not the preferred way to use MDX since it introduces a substantial amount of overhead and dramatically increases bundle sizes. It should also not be used with user input that isn’t sandboxed.
npm i -S @mdx-js/runtime
import React from 'react'import MDX from '@mdx-js/runtime'// Provide custom components for markdown elementsconst components =<h1 = />// Provide custom components that will be referenced as JSX// in the markdown stringconst scope =<h1>This is a demo component</h1>const mdx = `# Hello, world!<Demo />`<MDX = =>mdx</MDX>
mdx-js/mdx for ways to get started.
This organisation has a Code of Conduct. By interacting with this repository, organisation, or community you agree to abide by its terms.