The @tanstack/markdown/react entry requires React 18 or newer.
import {
Markdown,
renderBlockReact,
renderInlineReact,
renderMarkdownReact,
type MarkdownProps,
type MarkdownReactOptions,
} from '@tanstack/markdown/react'Extends RenderOptions with:
interface MarkdownReactOptions extends RenderOptions {
components?: Partial<
Record<string, string | React.ComponentType<any>>
>
}components replaces an emitted intrinsic or custom element by tag name.
Extends MarkdownReactOptions with children: MarkdownInput.
function Markdown(props: MarkdownProps): ReactElementRenders the document children inside a React fragment.
function renderMarkdownReact(
input: MarkdownInput,
options?: MarkdownReactOptions,
): ReactNodeReturns rendered React nodes without JSX component syntax.
function renderBlockReact(
node: BlockNode,
options?: MarkdownReactOptions,
key?: string,
): ReactElementRenders one block node. key is available for custom tree composition; normal document rendering supplies deterministic positional keys.
function renderInlineReact(
node: InlineNode,
options?: MarkdownReactOptions,
key?: string,
): ReactNodeRenders one inline node.
See the React Guide for component mapping and SSR usage.