Created
December 11, 2021 13:35
-
-
Save AnishDe12020/6f82688769fd1a6801fb1ce4d750ade3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { serialize } from "next-mdx-remote/serialize"; | |
import { MDXRemote } from "next-mdx-remote"; | |
export default function Home({ source }) { | |
return ( | |
<div> | |
<MDXRemote {...source} /> | |
</div> | |
); | |
} | |
export const getStaticProps = async () => { | |
const source = "```html\n<h1>Hello World</h1>\n```"; | |
const mdxSource = await serialize(source); | |
return { props: { source: mdxSource } }; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment