mdx-live
Add live code examples to MDX with react-live
npm i mdx-live
import React from 'react'import MDXLiveProvider from 'mdx-live'import Doc from './doc.mdx' <MDXLiveProvider> <Doc /> </MDXLiveProvider>
withMDXLive
Higher order component to render LiveCode
component when the language-.jsx
class name is present.
const components = code: // removes wrapping <pre> tag from MDX propschildren
LiveCode
Styled wrapper around react-live
<LiveCode = ='<h1>Hello {name}</h1>'/>
Props
previewStyle
editorStyle
errorStyle
previewProps
editorProps
errorProps
components
scope