If I have some stuff in a markdown file foo.md
, what is the best way to "inject" this into a component <Bar />
? I'm assuming I will have to use some props right? Or is MDX not suitable for this type of problem? Thanks!
Asked
Active
Viewed 211 times
0

SorghumBean
- 15
- 5
1 Answers
0
Edit: I think I've figured it out -- you can just directly import it like import Content from "./foo.mdx"
, you just need to configure some files correctly so the imports work (I was using nextjs and in next-env.d.ts
I needed to add declare module '*.mdx'
). Still curious if there are other ideas though.

SorghumBean
- 15
- 5