#Is it possible to import mdx into mdx?

6 messages · Page 1 of 1 (latest)

solemn hollyBOT
#
Still waiting for an answer?

It looks like no-one has responded to your question yet. People might not be available right now or don’t know how to answer your question. Want an answer while you wait? Try asking our experimental bot in #1095492539085230272.

fading terrace
#

Hey @void holly! Do I have it right that your setup looks like this?

---
# myComponent2.mdx
---
export const myComponent1 = <a href={"../../reference/types/undefined"}><code>Undefined</code></a>
---
# myComponent1.mdx
---
import { myComponent2 } from "./myComponent2 "

{ myComponent2 }
fading terrace
#

The # is a comment syntax, so was just trying to show the file name of file here.

#

I don’t think you can export components from other MDX files like that.

#

Oh wait. Have you tried including the .mdx extension here?

#
---
title: Page2
---

import { myComponent1 } from "./myComponent1.mdx"

{myComponent1}