COMPARISON · MARKDOWN

@mdx-js/react vs. mdast-util-mdx-jsx

Side-by-side comparison · 9 metrics · 13 criteria

@mdx-js/react v3.1.1 · MIT
Weekly Downloads
33.3M
Stars
19.9K
Gzip Size
3.4 kB
License
MIT
Last Updated
1y ago
Open Issues
22
Forks
1.2K
Unpacked Size
14.4 kB
Dependencies
2
mdast-util-mdx-jsx v3.2.2 · MIT
Weekly Downloads
70.0M
Stars
35
Gzip Size
5.3 kB
License
MIT
Last Updated
1y ago
Open Issues
1
Forks
8
Unpacked Size
58.8 kB
Dependencies
15
DOWNLOAD TRENDS

@mdx-js/react vs mdast-util-mdx-jsx downloads · last 12 months

Download trends for @mdx-js/react and mdast-util-mdx-jsx2 download series from Nov 2025 to Oct 2026. Use left and right arrow keys to inspect monthly values.054.7M109.4M164.1M218.8MNov 2025FebMayAugOct 2026
@mdx-js/react
mdast-util-mdx-jsx
FEATURE COMPARISON

Criteria · @mdx-js/react vs mdast-util-mdx-jsx

Gzip Footprint
@mdx-js/react ✓
Smaller reported gzip bundle at 3.4 kB
mdast-util-mdx-jsx
Larger reported gzip bundle at 5.3 kB
Rendering Role
@mdx-js/react ✓
Supports React-side MDX rendering integration
mdast-util-mdx-jsx
Represents and serializes syntax rather than rendering React components
Extension Model
@mdx-js/react
Uses React context as its integration point
mdast-util-mdx-jsx
Extends mdast parsing and serialization
Best-Fit Workflow
@mdx-js/react
Application rendering of MDX with React components
mdast-util-mdx-jsx
Tooling that must parse, transform, or emit MDX JSX
Component Mapping
@mdx-js/react ✓
Designed for providing React components to MDX
mdast-util-mdx-jsx
Does not provide React component mappings
Unpacked Footprint
@mdx-js/react ✓
Smaller reported unpacked size at 14.4 kB
mdast-util-mdx-jsx
Larger reported unpacked size at 58.8 kB
Integration Boundary
@mdx-js/react
Connects MDX content to a React rendering tree
mdast-util-mdx-jsx
Connects JSX syntax to an mdast document
Syntax Tree Handling
@mdx-js/react
Not focused on parsing or serializing JSX syntax trees
mdast-util-mdx-jsx ✓
Provides an mdast extension for JSX parsing and serialization
Content Transformation
@mdx-js/react
Targets component provision during React consumption
mdast-util-mdx-jsx ✓
Targets JSX-aware processing of mdast content
Primary Responsibility
@mdx-js/react
Supplies React context for MDX component mappings
mdast-util-mdx-jsx
Parses and serializes MDX JSX within mdast
Workflow Substitutability
@mdx-js/react
Not a substitute for mdast JSX parsing and serialization
mdast-util-mdx-jsx
Not a substitute for React context-based component mappings
Tree-Level JSX Preservation
@mdx-js/react
Not its stated purpose
mdast-util-mdx-jsx ✓
Handles MDX JSX through an mdast extension
React Dependency of the Use Case
@mdx-js/react ✓
Directly serves React-based MDX integration
mdast-util-mdx-jsx
Addresses mdast syntax processing rather than React integration
VERDICT

@mdx-js/react is for React applications that need MDX components to be supplied through React context. Its role is at the rendering boundary: it lets an application provide React component mappings for MDX content, making it relevant when authors use MDX and the consuming interface needs consistent, application-controlled component behavior. It is not primarily a Markdown syntax parser or serializer.

mdast-util-mdx-jsx is for tooling that reads or writes MDX JSX syntax as part of an mdast representation. Its focus is structural: it provides an mdast extension for parsing and serializing MDX or MDX.js JSX, so it suits developers building content-processing flows that must preserve or manipulate JSX elements in Markdown-derived syntax. It does not provide React context or render components into a React interface.

The central architectural difference is where each package enters the content lifecycle. @mdx-js/react connects already-produced MDX output to React through context and component mappings, whereas mdast-util-mdx-jsx works on the syntax and tree side, representing JSX within an mdast document for downstream processing or serialization. Choosing between them is therefore usually a boundary decision, not a choice between two implementations of the same function.

Their extension models also serve different responsibilities. With @mdx-js/react, the main integration point is the React context used by MDX rendering, which keeps component selection close to the application’s React tree. With mdast-util-mdx-jsx, the integration point is an mdast extension that participates in parsing and serializing; it is useful when a pipeline needs to inspect, transform, or emit JSX nodes without making React rendering the package’s concern.

The learning curve depends on the developer’s existing task: React developers configuring MDX component mappings will find @mdx-js/react aligned with a familiar context-based rendering model, while mdast-util-mdx-jsx requires understanding the mdast representation and its parse/serialize role. The provided details do not specify TypeScript features, particular debugging facilities, or additional tooling, so those should not determine the choice without checking the package documentation. A practical distinction is whether the work begins with rendered React content or with a syntax tree that must retain MDX JSX structure.

For a runtime-facing React application, @mdx-js/react has the smaller reported footprint: its gzip bundle is 3.4 kB, compared with 5.3 kB for mdast-util-mdx-jsx, and its unpacked size is 14.4 kB rather than 58.8 kB. Those figures favor @mdx-js/react when bundle cost is relevant, but they do not make it a substitute for syntax processing; mdast-util-mdx-jsx’s larger footprint corresponds to its distinct parse-and-serialize role. Neither measurement alone establishes end-to-end application performance.

Choose @mdx-js/react when an application already renders MDX through React and needs to provide or override the React components used by that content. Choose mdast-util-mdx-jsx when a content tool must parse or serialize MDX JSX in an mdast document, such as when transforming stored MDX while retaining JSX structure. If a system performs both syntax transformation and React rendering, the packages address separate stages and may be complementary; adopting one does not remove the need for the other stage’s capability.

The migration path is determined by the interface being replaced. Moving from @mdx-js/react to mdast-util-mdx-jsx means changing from context-driven component provision to syntax-tree parsing or serialization, so it is not a drop-in replacement; moving in the other direction means leaving tree-level JSX processing for React rendering integration. The project details identify both packages as MIT-licensed, but do not provide compatibility guarantees or release policies beyond their listed versions and update dates, so long-term maintenance decisions should be checked against the required MDX workflow rather than inferred from package role alone.

A useful edge case is content tooling that must preserve JSX without executing it: mdast-util-mdx-jsx addresses that representation and serialization need, while @mdx-js/react applies when the content is consumed as React-rendered MDX. Conversely, if an application only needs to map MDX components into its React tree, adding syntax-tree handling would solve a different problem. Keep the boundary explicit: choose based on whether the required output is an mdast document containing JSX structure or a React rendering environment with component mappings.

CORRECTIONS

Spot wrong data here?

A short note helps us fix it.

Anonymous · No account · No email back

RELATED COMPARISONS 8
@mdx-js/react vs rehype ★ 22.1K · 38.7M/wk @mdx-js/react vs shiki ★ 33.8K · 75.3M/wk @mdx-js/react vs remark ★ 28.9K · 44.4M/wk @mdx-js/react vs marked ★ 57.2K · 168.6M/wk mdast-util-mdx-jsx vs remark ★ 9.1K · 81.0M/wk mdast-util-mdx-jsx vs rehype ★ 2.3K · 75.3M/wk mdast-util-mdx-jsx vs shiki ★ 14.0K · 111.9M/wk marked vs mdast-util-mdx-jsx ★ 37.4K · 205.2M/wk