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
-
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.tsx
page file, I can add an import and a render of the mdx file, like so:hello.tsx
to read dynamically the blog contents from a file instead ofimport
ing it. When done this way, theimport
line in the mdx blog fileimport MyGallery from "../components/myGallery"
throws an error saying:import MyGallery
line 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 ofMDXProvider
and itscomponents
property to allow for the use of aMyGallery
component 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