-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
Description
Have you read the Contributing Guidelines on issues?
- I have read the Contributing Guidelines on issues.
Description
As absolute beginners in writing MDX, we were stumped by how to import markdown content in a .mdx file, even after reading the documentation.
Particularly confusing was how the name of the thing to import was derived from the file name.
In the documentation linked above
import PartialExample from './_markdown-partial-example.mdx';
where does PartialExample come from?
After too much trial and error, we determined that the name between import and from can in fact be anything, but its first letter must be uppercase:
import test from 'test.mdx';did not workimport Test from 'test.mdx';did workimport Anything from 'test.mdx';also worked
This is implicitly shown in the documentation page, but we still don't understand why it behaves like that. I believe test.mdx is turned into javascript eventually, so presumably it exports some symbol/object/... How is it even possible that we can import this using any old name? Why does it need to start with uppercase?
Could you describe this more explicitly in the documentation?
I would create a PR, but I lack the terminology and understanding.
Self-service
- I'd be willing to address this documentation request myself.