-
I use nextjs + mdx to write blog. This is my folder contain all mdx file: In index.md I have 2 components <Comp1>
<Item key="pikachu" type="light" />
<Item key="raichu" type="light" />
<Item key="chikorita" type="leaf" />
<Item key="mews" type="physic" />
</Comp1>
<Comp2>
<Item2 append="1" key="pikachu" type="light" />
<Item2 append="2" key="raichu" type="light" />
<Item2 append="3" key="chikorita" type="leaf" />
<Item2 append="4" key="mews" type="physic" />
</Comp2> Because data in {
"pikachu": "light",
"raichu": "light",
"chikorita": "leaf"
} Can I import data.json to index.md ? In index.md I should change <Comp1 jsonName="data" />
<Comp2 jsonName="data" /> |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Needs more info: this is way too short. Likely not though: you can't import json yet in ESM. In the future you could use import assertions, but they're not supported in most places yet. |
Beta Was this translation helpful? Give feedback.
Needs more info: this is way too short.
Likely not though: you can't import json yet in ESM. In the future you could use import assertions, but they're not supported in most places yet.