Replies: 1 comment
-
|
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
ChristianMurphy
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
AT A HIGH LEVEL, I want to allow the use of a
<MyGallery />component in my blog posts which are rendered via dynamic routing/[slug]. I looked at MDX to solve this problem.hello.tsxpage file, I can add an import and a render of the mdx file, like so:hello.tsxto read dynamically the blog contents from a file instead ofimporting it. When done this way, theimportline in the mdx blog fileimport MyGallery from "../components/myGallery"throws an error saying:import MyGalleryline in the mdx blog and instead use shortcodes to preload the custom mdx components globally. For this I followed the instructions on Gatsbyjs.com (which is admittedly not the framework I'm using) to use the services ofMDXProviderand itscomponentsproperty to allow for the use of aMyGallerycomponent in the mdx blog. With everything seemingly set up as per instructions, I receive this error:I've seen multiple examples of MDX being used in the NextJS framework but none of them are exactly what I am trying to achieve. Is there any tweaks anyone can think of to the above three scenarios that will get my hopes and dreams to come true? I've now used 3 different MDX compilers to no avail. All I want is to put photo galleries in my blogs 😭😭😭😭😭😭😭
Thank you in advance.
Beta Was this translation helpful? Give feedback.
All reactions