Skip to content

Instantly share code, notes, and snippets.

@AnishDe12020
Created December 11, 2021 13:35
Show Gist options
  • Save AnishDe12020/6f82688769fd1a6801fb1ce4d750ade3 to your computer and use it in GitHub Desktop.
Save AnishDe12020/6f82688769fd1a6801fb1ce4d750ade3 to your computer and use it in GitHub Desktop.
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