-
Notifications
You must be signed in to change notification settings - Fork 149
Closed
Description
Hi, thank you so much for the awesome package.
I am practicing with the very basic example that is there in the README file.
Here is the code I am using:
import { serialize } from "next-mdx-remote/serialize";
import { MDXRemote } from "next-mdx-remote";
const data = { product: "next" };
export default function TestPage({ source }) {
console.log("source object received", source);
return (
<div className="wrapper">
<MDXRemote {...source} />
</div>
);
}
export async function getStaticProps() {
const source = "Some **mdx** text with some data: {product}";
const mdxSource = await serialize(source, { scope: data });
return { props: { source: mdxSource } };
}
The problem is that the "product" variable is not being converted into its corresponding value i.e. "next". I am getting the exact same string on the front end.
This is what is rendered on screen: "Some mdx text with some data: {product}"
Although when I see the result of the console statement, the scope object is there and it does contain the value of "product".
P.S. I am relatively new to NextJS and English is also not my first language. Please pardon me if this is a noob's question.
Metadata
Metadata
Assignees
Labels
No labels