diff --git a/README.md b/README.md index e1fa9d9..f445706 100644 --- a/README.md +++ b/README.md @@ -54,6 +54,41 @@ While it may seem strange to see these two in the same file, this is one of the ### Additional Examples + + +
+ Using Nextjs App dir and Server Components + +```jsx +// app/posts/[slug]/page.js +import Post from "@/app/posts/[slug]/Post"; +import { serialize } from "next-mdx-remote/serialize"; + +export default async function TestPage() { + const source = 'Some **mdx** text, with a component ' + const mdxSource = await serialize(source); + + return ( + + ); +} + +``` + +```jsx +// app/posts/[slug]/page.js +"use client"; +import React from "react"; +import { MDXRemote } from "next-mdx-remote"; + +export default function Post(props: { source: any }) { + return ; +} + +``` + +
+
Parsing Frontmatter