Skip to content

Commit 14d69b2

Browse files
committed
add components prop pass-through
1 parent fb980f3 commit 14d69b2

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

packages/mdx/src/client/rsc.tsx

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { MDXRemote as BaseMDXRemote } from 'next-mdx-remote-client/rsc';
1+
import { MDXRemote as BaseMDXRemote, MDXComponents } from 'next-mdx-remote-client/rsc';
22
import { SerializeOptions } from 'next-mdx-remote-client/serialize';
33
import rehypeKatex from 'rehype-katex';
44
import remarkGfm from 'remark-gfm';
@@ -11,17 +11,20 @@ export async function MDXRemote({
1111
source,
1212
mdxOptions,
1313
scope,
14+
components,
1415
parseFrontmatter,
1516
}: {
1617
source: string;
1718
mdxOptions?: SerializeOptions['mdxOptions'];
1819
scope?: SerializeOptions['scope'];
20+
components?: MDXComponents;
1921
parseFrontmatter?: SerializeOptions['parseFrontmatter'];
2022
}) {
2123
return (
2224
// @ts-expect-error Server Component
2325
<BaseMDXRemote
2426
source={source}
27+
components={components}
2528
options={{
2629
scope,
2730
mdxOptions: {
@@ -33,12 +36,7 @@ export async function MDXRemote({
3336
],
3437
rehypePlugins: [
3538
rehypeKatex,
36-
[
37-
rehypeSyntaxHighlighting,
38-
{
39-
ignoreMissing: true,
40-
},
41-
],
39+
[rehypeSyntaxHighlighting, { ignoreMissing: true }],
4240
...(mdxOptions?.rehypePlugins || []),
4341
],
4442
format: mdxOptions?.format || 'mdx',

0 commit comments

Comments
 (0)