Why is <MDXRemote> outputting an undefined object? #2480
-
I have a code here that fetches an array of MDX strings from a mongoDB server, and per a previous discussion post, I use MDXRemote to render it as an mdx string.
This essentially just takes the blog strings array returned from the MongoDB server, and tries to convert it into a bunch of MDX renderings in resolvedBlogMDX . The issue now is that resolvedBlogMDX contains undefined. Here's the print statements from the console.log() outputs:
As you can see, resolvedBlogMDX contains an "undefined" item, but blogs has the correct output with the mdx string. Why is it outputting undefined? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
It looks like you have problems with your knowledge of JavaScript though: your arrow function has braces ( |
Beta Was this translation helpful? Give feedback.
MDXRemote
isn’t maintained here. You’re best off asking there.It looks like you have problems with your knowledge of JavaScript though: your arrow function has braces (
{
and}
) but does not have areturn
statement. So, it returnsundefined
.