File tree Expand file tree Collapse file tree 5 files changed +782
-9
lines changed Expand file tree Collapse file tree 5 files changed +782
-9
lines changed Original file line number Diff line number Diff line change @@ -101,6 +101,7 @@ export default async function BlogPost({ params }: BlogPostProps) {
101101 </ header >
102102
103103 < div className = "dark:prose-invert w-full prose-pre:overflow-x-auto " >
104+ { /* @ts -ignore */ }
104105 < MDXRenderer code = { post . body . code } />
105106 </ div >
106107
Original file line number Diff line number Diff line change 1- "use client" ;
2-
3- import { useMDXComponent } from "next-contentlayer/hooks" ;
1+ import { MDXRemote } from "next-mdx-remote/rsc" ;
42import { MDXComponents } from "./mdx-components" ;
53
64interface MDXRendererProps {
7- code : string ;
5+ source : string ;
86}
97
10- export function MDXRenderer ( { code } : MDXRendererProps ) {
11- const MDXContent = useMDXComponent ( code ) ;
12-
13- return < MDXContent components = { MDXComponents as any } /> ;
8+ export function MDXRenderer ( { source } : MDXRendererProps ) {
9+ return (
10+ < MDXRemote
11+ source = { source }
12+ components = { MDXComponents as any }
13+ options = { {
14+ mdxOptions : {
15+ remarkPlugins : [ ] ,
16+ rehypePlugins : [ ] ,
17+ } ,
18+ } }
19+ />
20+ ) ;
1421}
Original file line number Diff line number Diff line change 2121 "lucide-react" : " ^0.525.0" ,
2222 "next" : " ^15.5.0" ,
2323 "next-contentlayer" : " ^0.3.4" ,
24+ "next-mdx-remote" : " ^5.0.0" ,
2425 "next-themes" : " ^0.4.6" ,
2526 "react" : " ^19.1.1" ,
2627 "react-dom" : " ^19.1.1" ,
Original file line number Diff line number Diff line change 1919 "turbo" : " ^2.5.6" ,
2020 "typescript" : " 5.8.3"
2121 },
22- "packageManager" : " pnpm@10.4 .1" ,
22+ "packageManager" : " pnpm@10.15 .1" ,
2323 "engines" : {
2424 "node" : " >=20"
2525 }
You can’t perform that action at this time.
0 commit comments