ipikuka
Import a client component with extension .mjs in MDX
🔙 Read in 6 min., written by ipikuka
1. Import a Client Component
The relative link is relative to the module which MDXRemote called,
since the baseUrl is setted as import.meta.url in the options.
import ExampleForm from "../../../mdxComponents/ExampleForm.mjs";
2. Import a Client Component via dynamic import
The relative link is relative to the module which MDXRemote called,
since the baseUrl is setted as import.meta.url in the options.
export const ExampleForm = (await import("../../../mdxComponents/ExampleForm.mjs")).default;