MDX with Gatsby Integration returning passed function alone #2177
-
Hello, This is my first question 🙏🏽 I'm trying to integrate MDX with my gatsby blog, I've gotten to the stage where I get to render my blog content in MDX. I'm making use of GraphQL as my API Layer, so it returns the body of the mdx file in a string of this format
I compile this result by My issue is that the result of the render just happens to be a string containing the compiled functions, I'm unable to render the actual MDX to the screen
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Welcome @jideabdqudus! If so, |
Beta Was this translation helpful? Give feedback.
Welcome @jideabdqudus!
Sorry you ran into a spot of trouble.
It sounds like you want MDX to be dynamically rendered client side? And that you are using
@mdx-js/mdx
to do so?If so,
evaluate
is the function from@mdx-js/mdx
you are looking for https://mdxjs.com/packages/mdx/#evaluatefile-options.compile
generates just the JavaScript source code that a browser or server could then choose to run, but isn't run or rendered into a react component yet.